[llvm] r337398 - [MC] Fix nested macro body parsing
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 18 09:17:03 PDT 2018
Author: niravd
Date: Wed Jul 18 09:17:03 2018
New Revision: 337398
URL: http://llvm.org/viewvc/llvm-project?rev=337398&view=rev
Log:
[MC] Fix nested macro body parsing
Add missing .rep case in nestlevel checking for macro body parsing.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/directive_rept.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=337398&r1=337397&r2=337398&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed Jul 18 09:17:03 2018
@@ -5317,7 +5317,8 @@ MCAsmMacro *AsmParser::parseMacroLikeBod
}
if (Lexer.is(AsmToken::Identifier) &&
- (getTok().getIdentifier() == ".rept" ||
+ (getTok().getIdentifier() == ".rep" ||
+ getTok().getIdentifier() == ".rept" ||
getTok().getIdentifier() == ".irp" ||
getTok().getIdentifier() == ".irpc")) {
++NestLevel;
Modified: llvm/trunk/test/MC/AsmParser/directive_rept.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_rept.s?rev=337398&r1=337397&r2=337398&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_rept.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_rept.s Wed Jul 18 09:17:03 2018
@@ -28,3 +28,16 @@ half_a_dozen_daffodils:
# CHECK: .long 3674148113
# CHECK: .long 3674148113
+
+nested_reps:
+ .rep 2
+ .rep 2
+ .long 0xdeadbeef
+ .endr
+ .endr
+
+# CHECK-LABEL: nested_reps
+# CHECK: .long 3735928559
+# CHECK: .long 3735928559
+# CHECK: .long 3735928559
+# CHECK: .long 3735928559
More information about the llvm-commits
mailing list