diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-08-12 00:55:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-12 00:55:38 +0000 |
commit | f1e29d4c21d15f9e1e3a64f3b92b1aa9908e4f63 (patch) | |
tree | 2b8a2bbfa78f1c5e5eb6b2ae447bfeeb196538dc /lib/MC/MCParser | |
parent | 4f98f834593f0a107268d19a557b63f0da33a751 (diff) | |
download | external_llvm-f1e29d4c21d15f9e1e3a64f3b92b1aa9908e4f63.zip external_llvm-f1e29d4c21d15f9e1e3a64f3b92b1aa9908e4f63.tar.gz external_llvm-f1e29d4c21d15f9e1e3a64f3b92b1aa9908e4f63.tar.bz2 |
MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 016f8f9..87a4a88 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -934,17 +934,11 @@ bool AsmParser::ParseStatement() { // If parsing succeeded, match the instruction. if (!HadError) { MCInst Inst; - if (!getTargetParser().MatchInstruction(ParsedOperands, Inst)) { + if (!getTargetParser().MatchInstruction(IDLoc, ParsedOperands, Inst)) { // Emit the instruction on success. Out.EmitInstruction(Inst); - } else { - // Otherwise emit a diagnostic about the match failure and set the error - // flag. - // - // FIXME: We should give nicer diagnostics about the exact failure. - Error(IDLoc, "unrecognized instruction"); + } else HadError = true; - } } // If there was no error, consume the end-of-statement token. Otherwise this |