diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-09-25 16:30:16 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-09-25 16:30:16 +0000 |
commit | 317d8f339c2ee7b59e0e8cc81646ef664e20532d (patch) | |
tree | 66e4c9112b994bab90826cb4e180019bfcdd5188 | |
parent | 1370d37f60a173b2acf0afce92db063f06b30b2d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164608 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaStmtAsm.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index 922777e07d..792a91332e 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -567,7 +567,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, 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 = |