[llvm-commits] [llvm] r129322 - /llvm/trunk/lib/MC/MCParser/AsmParser.cpp

Eric Christopher echristo at apple.com
Mon Apr 11 17:03:14 PDT 2011

Author: echristo
Date: Mon Apr 11 19:03:13 2011
New Revision: 129322

URL: http://llvm.org/viewvc/llvm-project?rev=129322&view=rev
To avoid printing out multiple error messages for cases like:

.long 80+08

go ahead and assume that if we've got an Error token that we handled it
already. Otherwise if it's a token we can't handle then go ahead and
return the default error.


Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=129322&r1=129321&r2=129322&view=diff
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon Apr 11 19:03:13 2011
@@ -539,6 +539,9 @@
   switch (Lexer.getKind()) {
     return TokError("unknown token in expression");
+  // If we have an error assume that we've already handled it.
+  case AsmToken::Error:
+    return true;
   case AsmToken::Exclaim:
     Lex(); // Eat the operator.
     if (ParsePrimaryExpr(Res, EndLoc))

More information about the llvm-commits mailing list