[ms-inline asm] Reset the opcode prior to parsing a statement.
llvm-svn: 166349
This commit is contained in:
parent
66e2b20d39
commit
f1f6a72901
|
@ -319,6 +319,7 @@ private:
|
||||||
// MS-style inline assembly parsing.
|
// MS-style inline assembly parsing.
|
||||||
bool isInstruction() { return Opcode != (unsigned)~0x0; }
|
bool isInstruction() { return Opcode != (unsigned)~0x0; }
|
||||||
unsigned getOpcode() { return Opcode; }
|
unsigned getOpcode() { return Opcode; }
|
||||||
|
void setOpcode(unsigned Value) { Opcode = Value; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Generic implementations of directive handling, etc. which is shared
|
/// \brief Generic implementations of directive handling, etc. which is shared
|
||||||
|
@ -3615,7 +3616,11 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||||
unsigned InputIdx = 0;
|
unsigned InputIdx = 0;
|
||||||
unsigned OutputIdx = 0;
|
unsigned OutputIdx = 0;
|
||||||
while (getLexer().isNot(AsmToken::Eof)) {
|
while (getLexer().isNot(AsmToken::Eof)) {
|
||||||
if (ParseStatement()) return true;
|
// Clear the opcode.
|
||||||
|
setOpcode(~0x0);
|
||||||
|
|
||||||
|
if (ParseStatement())
|
||||||
|
return true;
|
||||||
|
|
||||||
if (isInstruction()) {
|
if (isInstruction()) {
|
||||||
const MCInstrDesc &Desc = MII->get(getOpcode());
|
const MCInstrDesc &Desc = MII->get(getOpcode());
|
||||||
|
|
|
@ -1553,9 +1553,6 @@ MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
|
||||||
assert(Op->isToken() && "Leading operand should always be a mnemonic!");
|
assert(Op->isToken() && "Leading operand should always be a mnemonic!");
|
||||||
ArrayRef<SMRange> EmptyRanges = ArrayRef<SMRange>();
|
ArrayRef<SMRange> EmptyRanges = ArrayRef<SMRange>();
|
||||||
|
|
||||||
// Clear the opcode.
|
|
||||||
Opcode = ~0x0;
|
|
||||||
|
|
||||||
// First, handle aliases that expand to multiple instructions.
|
// First, handle aliases that expand to multiple instructions.
|
||||||
// FIXME: This should be replaced with a real .td file alias mechanism.
|
// FIXME: This should be replaced with a real .td file alias mechanism.
|
||||||
// Also, MatchInstructionImpl should actually *do* the EmitInstruction
|
// Also, MatchInstructionImpl should actually *do* the EmitInstruction
|
||||||
|
|
Loading…
Reference in New Issue