From 3d9f2d3361d8b891c487a401a67d54901cec47fc Mon Sep 17 00:00:00 2001 From: never Date: Wed, 6 Jul 2011 09:27:54 -0700 Subject: [PATCH] 7061101: adlc should complain about mixing block and expression forms of ins_encode Reviewed-by: kvn --- src/share/vm/adlc/adlparse.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/share/vm/adlc/adlparse.cpp b/src/share/vm/adlc/adlparse.cpp index c2d9ee0ab..c5381dfe2 100644 --- a/src/share/vm/adlc/adlparse.cpp +++ b/src/share/vm/adlc/adlparse.cpp @@ -2812,6 +2812,13 @@ void ADLParser::ins_encode_parse_block(InstructForm& inst) { params->add_entry(param); } + // Check for duplicate ins_encode sections after parsing the block + // so that parsing can continue and find any other errors. + if (inst._insencode != NULL) { + parse_err(SYNERR, "Multiple ins_encode sections defined\n"); + return; + } + // Set encode class of this instruction. inst._insencode = encrule; } @@ -3044,6 +3051,13 @@ void ADLParser::ins_encode_parse(InstructForm& inst) { next_char(); // move past ';' skipws(); // be friendly to oper_parse() + // Check for duplicate ins_encode sections after parsing the block + // so that parsing can continue and find any other errors. + if (inst._insencode != NULL) { + parse_err(SYNERR, "Multiple ins_encode sections defined\n"); + return; + } + // Debug Stuff if (_AD._adl_debug > 1) fprintf(stderr,"Instruction Encode: %s\n", ec_name); -- GitLab