[llvm-commits] [llvm] r166349 - in /llvm/trunk/lib: MC/MCParser/AsmParser.cpp Target/X86/AsmParser/X86AsmParser.cpp
Chad Rosier
mcrosier at apple.com
Fri Oct 19 15:57:33 PDT 2012
Author: mcrosier
Date: Fri Oct 19 17:57:33 2012
New Revision: 166349
URL: http://llvm.org/viewvc/llvm-project?rev=166349&view=rev
Log:
[ms-inline asm] Reset the opcode prior to parsing a statement.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.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=166349&r1=166348&r2=166349&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Fri Oct 19 17:57:33 2012
@@ -319,6 +319,7 @@
// MS-style inline assembly parsing.
bool isInstruction() { return Opcode != (unsigned)~0x0; }
unsigned getOpcode() { return Opcode; }
+ void setOpcode(unsigned Value) { Opcode = Value; }
};
/// \brief Generic implementations of directive handling, etc. which is shared
@@ -3615,7 +3616,11 @@
unsigned InputIdx = 0;
unsigned OutputIdx = 0;
while (getLexer().isNot(AsmToken::Eof)) {
- if (ParseStatement()) return true;
+ // Clear the opcode.
+ setOpcode(~0x0);
+
+ if (ParseStatement())
+ return true;
if (isInstruction()) {
const MCInstrDesc &Desc = MII->get(getOpcode());
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=166349&r1=166348&r2=166349&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Fri Oct 19 17:57:33 2012
@@ -1553,9 +1553,6 @@
assert(Op->isToken() && "Leading operand should always be a mnemonic!");
ArrayRef<SMRange> EmptyRanges = ArrayRef<SMRange>();
- // Clear the opcode.
- Opcode = ~0x0;
-
// First, handle aliases that expand to multiple instructions.
// FIXME: This should be replaced with a real .td file alias mechanism.
// Also, MatchInstructionImpl should actually *do* the EmitInstruction
More information about the llvm-commits
mailing list