]> granicus.if.org Git - clang/commitdiff
Use the target address space value when mangling names.
authorTanya Lattner <tonic@nondot.org>
Fri, 8 Feb 2013 01:07:32 +0000 (01:07 +0000)
committerTanya Lattner <tonic@nondot.org>
Fri, 8 Feb 2013 01:07:32 +0000 (01:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ItaniumMangle.cpp
test/CodeGenCXX/mangle.cpp
test/CodeGenOpenCL/local.cl

index 792bda635419f4a8e7d220074cdc00fa12fb32a8..dadf9d3cc52f22371d6467d22b6341de3a9984d3 100644 (file)
@@ -1668,7 +1668,8 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals) {
     // 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;
   }
   
index 5dad030d5ea2f5b1c4a905aa08d244caa1bf498a..e7955a8ed910cb625d6a96f53deef292972463e2 100644 (file)
@@ -872,3 +872,6 @@ namespace test37 {
     func(foo().d);
   }
 }
+
+// CHECK: define void @_Z6ASfuncPU3AS3i
+void ASfunc(__attribute__((address_space(3))) int* x) {}
index 32fa7be0f764d38be8bc0d02112182474e27c32c..b4bd0085dfad650da366c3068bfe5cd082bfccdb 100644 (file)
@@ -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;
+}