[llvm-commits] [llvm] r113347 - in /llvm/trunk/lib: MC/MCParser/AsmParser.cpp Target/ARM/AsmParser/ARMAsmParser.cpp Target/X86/AsmParser/X86AsmParser.cpp
Chris Lattner
sabre at nondot.org
Tue Sep 7 22:10:46 PDT 2010
Author: lattner
Date: Wed Sep 8 00:10:46 2010
New Revision: 113347
URL: http://llvm.org/viewvc/llvm-project?rev=113347&view=rev
Log:
change the MC "ParseInstruction" interface to make it the
implementation's job to check for and lex the EndOfStatement
marker.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=113347&r1=113346&r2=113347&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed Sep 8 00:10:46 2010
@@ -917,8 +917,6 @@
SmallVector<MCParsedAsmOperand*, 8> ParsedOperands;
bool HadError = getTargetParser().ParseInstruction(Opcode.str(), IDLoc,
ParsedOperands);
- if (!HadError && Lexer.isNot(AsmToken::EndOfStatement))
- HadError = TokError("unexpected token in argument list");
// Dump the parsed representation, if requested.
if (getShowParsedOperands()) {
@@ -945,11 +943,6 @@
HadError = true;
}
- // If there was no error, consume the end-of-statement token. Otherwise this
- // will be done by our caller.
- if (!HadError)
- Lex();
-
// Free any parsed operands.
for (unsigned i = 0, e = ParsedOperands.size(); i != e; ++i)
delete ParsedOperands[i];
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=113347&r1=113346&r2=113347&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Wed Sep 8 00:10:46 2010
@@ -737,6 +737,11 @@
Operands.push_back(Op.take());
}
}
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in argument list");
+ Parser.Lex(); // Consume the EndOfStatement
+
return false;
}
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=113347&r1=113346&r2=113347&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Sep 8 00:10:46 2010
@@ -786,6 +786,10 @@
return true;
}
}
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in argument list");
+ Parser.Lex(); // Consume the EndOfStatement
// FIXME: Hack to handle recognizing s{hr,ar,hl}? $1.
if ((Name.startswith("shr") || Name.startswith("sar") ||
More information about the llvm-commits
mailing list