[cfe-commits] r164608 - /cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Bob Wilson bob.wilson at apple.com
Tue Sep 25 09:30:16 PDT 2012


Author: bwilson
Date: Tue Sep 25 11:30:16 2012
New Revision: 164608

URL: http://llvm.org/viewvc/llvm-project?rev=164608&view=rev
Log:
Examine the last, not the first, instruction from the MC matcher.

If an MS-style inline asm is matched to multiple instructions, e.g., with a
a WAIT-prefix, then we need to examine the operands of the last instruction
instruction, not the prefix instruction.

Modified:
    cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=164608&r1=164607&r2=164608&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Tue Sep 25 11:30:16 2012
@@ -567,7 +567,7 @@
     if (HadError) { DEF_SIMPLE_MSASM(EmptyAsmStr); return Owned(NS); }
 
     // Get the instruction descriptor.
-    llvm::MCInst Inst = Instrs[0];
+    llvm::MCInst Inst = Instrs.back();
     const llvm::MCInstrInfo *MII = TheTarget->createMCInstrInfo();
     const llvm::MCInstrDesc &Desc = MII->get(Inst.getOpcode());
     llvm::MCInstPrinter *IP =





More information about the cfe-commits mailing list