[cfe-commits] r129001 - in /cfe/trunk: lib/AST/ItaniumMangle.cpp test/CodeGen/mangle.c

Peter Collingbourne peter at pcc.me.uk
Wed Apr 6 05:29:09 PDT 2011


Author: pcc
Date: Wed Apr  6 07:29:09 2011
New Revision: 129001

URL: http://llvm.org/viewvc/llvm-project?rev=129001&view=rev
Log:
Do not use IR marker for LLVM intrinsics

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGen/mangle.c

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=129001&r1=129000&r2=129001&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Wed Apr  6 07:29:09 2011
@@ -334,10 +334,11 @@
     // another has a "\01foo". That is known to happen on ELF with the
     // tricks normally used for producing aliases (PR9177). Fortunately the
     // llvm mangler on ELF is a nop, so we can just avoid adding the \01
-    // marker.
+    // marker.  We also avoid adding the marker if this is an alias for an
+    // LLVM intrinsic.
     llvm::StringRef UserLabelPrefix =
       getASTContext().Target.getUserLabelPrefix();
-    if (!UserLabelPrefix.empty())
+    if (!UserLabelPrefix.empty() && !ALA->getLabel().startswith("llvm."))
       Out << '\01';  // LLVM IR Marker for __asm("foo")
 
     Out << ALA->getLabel();

Modified: cfe/trunk/test/CodeGen/mangle.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle.c?rev=129001&r1=129000&r2=129001&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle.c (original)
+++ cfe/trunk/test/CodeGen/mangle.c Wed Apr  6 07:29:09 2011
@@ -63,3 +63,12 @@
 // CHECK: @_Z4foo9Dv4_f
 typedef __attribute__(( vector_size(16) )) float float4;
 void __attribute__((__overloadable__)) foo9(float4 f) {}
+
+// Intrinsic calls.
+extern int llvm_cas(volatile int*, int, int)
+  __asm__("llvm.atomic.cmp.swap.i32.p0i32");
+
+int foo10(volatile int* add, int from, int to) {
+  // CHECK: call i32 @llvm.atomic.cmp.swap.i32.p0i32
+  return llvm_cas(add, from, to);
+}





More information about the cfe-commits mailing list