1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

[ms-inline asm] If we parsed a statement and the opcode is valid, then it's an instruction.

llvm-svn: 165955
This commit is contained in:
Chad Rosier 2012-10-15 19:08:18 +00:00
parent e554bb55b6
commit 860153bf6d
2 changed files with 5 additions and 5 deletions

View File

@ -136,9 +136,6 @@ private:
/// ParsingInlineAsm - Are we parsing ms-style inline assembly?
bool ParsingInlineAsm;
/// IsInstruction - Was the last parsed statement an instruction?
bool IsInstruction;
/// ParsedOperands - The parsed operands from the last parsed statement.
SmallVector<MCParsedAsmOperand*, 8> ParsedOperands;
@ -195,7 +192,7 @@ public:
delete ParsedOperands[i];
ParsedOperands.clear();
}
bool isInstruction() { return IsInstruction; }
bool isInstruction() { return Opcode != (unsigned)~0x0; }
unsigned getOpcode() { return Opcode; }
bool ParseExpression(const MCExpr *&Res);
@ -439,7 +436,7 @@ AsmParser::AsmParser(SourceMgr &_SM, MCContext &_Ctx,
GenericParser(new GenericAsmParser), PlatformParser(0),
CurBuffer(0), MacrosEnabled(true), CppHashLineNumber(0),
AssemblerDialect(~0U), IsDarwin(false), ParsingInlineAsm(false),
IsInstruction(false), Opcode(0) {
Opcode(~0x0) {
// Save the old handler.
SavedDiagHandler = SrcMgr.getDiagHandler();
SavedDiagContext = SrcMgr.getDiagContext();

View File

@ -1526,6 +1526,9 @@ MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
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