[cfe-commits] r161701 - /cfe/trunk/lib/Sema/SemaStmt.cpp

Chad Rosier mcrosier at apple.com
Fri Aug 10 14:27:11 PDT 2012


Author: mcrosier
Date: Fri Aug 10 16:27:11 2012
New Revision: 161701

URL: http://llvm.org/viewvc/llvm-project?rev=161701&view=rev
Log:
[ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
statements.  Therefore, we can't pass the PatchedAsmString to the AsmParser
and expect things to work.

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

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=161701&r1=161700&r2=161701&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Fri Aug 10 16:27:11 2012
@@ -2902,6 +2902,15 @@
   std::string PatchedAsmString =
     PatchMSAsmString(*this, IsSimple, AsmLoc, AsmToks, Context.getTargetInfo());
 
+  // PatchMSAsmString doesn't correctly patch non-simple asm statements.
+  if (!IsSimple) {
+    MSAsmStmt *NS =
+      new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
+                              /* IsVolatile */ true, AsmToks, LineEnds,
+                              AsmString, Clobbers, EndLoc);
+    return Owned(NS);
+  }
+
   // Initialize targets and assembly printers/parsers.
   llvm::InitializeAllTargetInfos();
   llvm::InitializeAllTargetMCs();





More information about the cfe-commits mailing list