r174688 - Use the target address space value when mangling names.

Tanya Lattner tonic at nondot.org
Thu Feb 7 17:07:32 PST 2013


Author: tbrethou
Date: Thu Feb  7 19:07:32 2013
New Revision: 174688

URL: http://llvm.org/viewvc/llvm-project?rev=174688&view=rev
Log:
Use the target address space value when mangling names.

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp
    cfe/trunk/test/CodeGenOpenCL/local.cl

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=174688&r1=174687&r2=174688&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Thu Feb  7 19:07:32 2013
@@ -1668,7 +1668,8 @@ void CXXNameMangler::mangleQualifiers(Qu
     // where <address-space-number> is a source name consisting of 'AS' 
     // followed by the address space <number>.
     SmallString<64> ASString;
-    ASString = "AS" + llvm::utostr_32(Quals.getAddressSpace());
+    ASString = "AS" + llvm::utostr_32(
+        Context.getASTContext().getTargetAddressSpace(Quals.getAddressSpace()));
     Out << 'U' << ASString.size() << ASString;
   }
   

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=174688&r1=174687&r2=174688&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Thu Feb  7 19:07:32 2013
@@ -872,3 +872,6 @@ namespace test37 {
     func(foo().d);
   }
 }
+
+// CHECK: define void @_Z6ASfuncPU3AS3i
+void ASfunc(__attribute__((address_space(3))) int* x) {}

Modified: cfe/trunk/test/CodeGenOpenCL/local.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/local.cl?rev=174688&r1=174687&r2=174688&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/local.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/local.cl Thu Feb  7 19:07:32 2013
@@ -5,3 +5,8 @@ __kernel void foo(void) {
   __local int i;
   ++i;
 }
+
+// CHECK: define void @_Z3barPU3AS2i
+__kernel void __attribute__((__overloadable__)) bar(local int *x) {
+  *x = 5;
+}





More information about the cfe-commits mailing list