diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-15 19:08:18 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-15 19:08:18 +0000 |
commit | f3bc59968052d152afea6b288007c31edb738b3e (patch) | |
tree | 1761ae44d9d148956033c1fb46bbe511dea8c625 | |
parent | b41459a3c08572e335f9d8f8933564dc01d26c52 (diff) | |
download | bcm5719-llvm-f3bc59968052d152afea6b288007c31edb738b3e.tar.gz bcm5719-llvm-f3bc59968052d152afea6b288007c31edb738b3e.zip |
[ms-inline asm] If we parsed a statement and the opcode is valid, then it's an instruction.
llvm-svn: 165955
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 0a8053121c8..0406ff8d446 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -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(); diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 683d6949094..454664e3ed1 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -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 |