MC: Remove errant EatToEndOfStatement() in asm parser.
authorJim Grosbach <grosbach@apple.com>
Tue, 1 May 2012 18:38:24 +0000 (18:38 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 1 May 2012 18:38:24 +0000 (18:38 +0000)
The caller is already responsible for eating any additional input on the
line. Putting an additional EatToEndOfStatement() in ParseStatement()
causes an entire extra statement to be consumed when treating warnings
as errors. For example, test/MC/macros.s will assert() because the
.endmacro directive is missed as a result.

rdar://11355843

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155925 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmParser.cpp

index 8aef43cb0b4cf9e38d7d0aa24d8714caa5d4e7c6..ec137e28913da8f8e55604c3e04657bd1320571b 100644 (file)
@@ -1238,9 +1238,7 @@ bool AsmParser::ParseStatement() {
     if (!getTargetParser().ParseDirective(ID))
       return false;
 
-    bool retval = Warning(IDLoc, "ignoring directive for now");
-    EatToEndOfStatement();
-    return retval;
+    return Warning(IDLoc, "ignoring directive for now");
   }
 
   CheckForValidSection();