[cfe-commits] r161642 - in /cfe/trunk: lib/CodeGen/CGStmt.cpp test/CodeGen/asm.c test/CodeGen/ms-inline-asm.c

Chad Rosier mcrosier at apple.com
Thu Aug 9 17:00:34 PDT 2012


Author: mcrosier
Date: Thu Aug  9 19:00:34 2012
New Revision: 161642

URL: http://llvm.org/viewvc/llvm-project?rev=161642&view=rev
Log:
[ms-inline asm] Use the new Inline Asm Non-Standard Dialect attribute.

Modified:
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/test/CodeGen/asm.c
    cfe/trunk/test/CodeGen/ms-inline-asm.c

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=161642&r1=161641&r2=161642&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Aug  9 19:00:34 2012
@@ -1701,4 +1701,5 @@
     llvm::InlineAsm::get(FTy, *S.getAsmString(), MachineClobbers, true);
   llvm::CallInst *Result = Builder.CreateCall(IA, Args);
   Result->addAttribute(~0, llvm::Attribute::NoUnwind);
+  Result->addAttribute(~0, llvm::Attribute::IANSDialect);
 }

Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=161642&r1=161641&r2=161642&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Thu Aug  9 19:00:34 2012
@@ -220,3 +220,13 @@
 void t26 (__m256i *p) {
   __asm__ volatile("vmovaps  %0, %%ymm0" :: "m" (*(__m256i*)p) : "ymm0");
 }
+
+// Check to make sure the inline asm non-standard dialect attribute _not_ is
+// emitted.
+void t27(void) {
+  asm volatile("nop");
+// CHECK: @t27
+// CHECK: call void asm sideeffect "nop"
+// CHECK-NOT: ia_nsdialect
+// CHECK: ret void
+}

Modified: cfe/trunk/test/CodeGen/ms-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=161642&r1=161641&r2=161642&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c Thu Aug  9 19:00:34 2012
@@ -2,7 +2,7 @@
 
 void t1() {
 // CHECK: @t1
-// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
 // CHECK: ret void
   __asm {}
 }





More information about the cfe-commits mailing list