diff options
author | Eric Christopher <echristo@apple.com> | 2011-04-12 00:03:13 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-04-12 00:03:13 +0000 |
commit | 104af0619eebcbae8ba1cb5d640912b72a0c155a (patch) | |
tree | 516d432bc3f6012870d01af6baeeab60f9ecffcb /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | 507992e909825c807f7972626efabf476adea8f7 (diff) | |
download | bcm5719-llvm-104af0619eebcbae8ba1cb5d640912b72a0c155a.tar.gz bcm5719-llvm-104af0619eebcbae8ba1cb5d640912b72a0c155a.zip |
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.
llvm-svn: 129322
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 8af4ac62e22..418b5101514 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -539,6 +539,9 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { switch (Lexer.getKind()) { default: 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)) |