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 | 2ecc3bb4f79a54b1bda6ce3629526c590aae3f32 (patch) | |
tree | 336ece1f6504a8a017d92428e8bd6de902bf3968 /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | 167b9d7f306652d0468f2e615e1014d7b86a90c8 (diff) | |
download | bcm5719-llvm-2ecc3bb4f79a54b1bda6ce3629526c590aae3f32.tar.gz bcm5719-llvm-2ecc3bb4f79a54b1bda6ce3629526c590aae3f32.zip |
MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.
llvm-svn: 110889
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 016f8f96a36..87a4a886bc8 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/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 |