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 | 2ae71c9eabb91083ac98f49da2e3a4561a5b219c (patch) | |
| tree | 2b8a2bbfa78f1c5e5eb6b2ae447bfeeb196538dc /lib/MC | |
| parent | 049a7528a0bbafcc9c7ef844cea64d27dbc95f98 (diff) | |
| download | external_llvm-2ae71c9eabb91083ac98f49da2e3a4561a5b219c.zip external_llvm-2ae71c9eabb91083ac98f49da2e3a4561a5b219c.tar.gz external_llvm-2ae71c9eabb91083ac98f49da2e3a4561a5b219c.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')
| -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 |
