summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-21 01:50:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-21 01:50:12 +0000
commit6839d23be79f9ff25f314889365eb3fa8c251d60 (patch)
tree326eef75c701b0b29aee7dc7a4378e2551a92182
parent6d379abd8f87a36c8638a894d59a4b72fd892946 (diff)
downloadbcm5719-llvm-6839d23be79f9ff25f314889365eb3fa8c251d60.tar.gz
bcm5719-llvm-6839d23be79f9ff25f314889365eb3fa8c251d60.zip
Now that r199688 avoids the real issue, use private linkage for objc strings.
llvm-svn: 199705
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
-rw-r--r--clang/test/CodeGen/cfstring.c6
-rw-r--r--clang/test/CodeGen/darwin-string-literals.c4
3 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 12edab7cd67..7f77df00f2c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2383,11 +2383,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
// FIXME: why do utf strings get "_" labels instead of "L" labels?
Linkage = llvm::GlobalValue::InternalLinkage;
else
- // FIXME: With OS X ld 123.2 (xcode 4) and LTO we would get a linker error
- // when using private linkage. It is not clear if this is a bug in ld
- // or a reasonable new restriction.
- Linkage = llvm::GlobalValue::LinkerPrivateLinkage;
-
+ Linkage = llvm::GlobalValue::PrivateLinkage;
+
// Note: -fwritable-strings doesn't make the backing store strings of
// CFStrings writable. (See <rdar://problem/10657500>)
llvm::GlobalVariable *GV =
diff --git a/clang/test/CodeGen/cfstring.c b/clang/test/CodeGen/cfstring.c
index f73ffc60826..fc86e42a6fc 100644
--- a/clang/test/CodeGen/cfstring.c
+++ b/clang/test/CodeGen/cfstring.c
@@ -5,9 +5,9 @@
//
// RUN: %clang_cc1 -fwritable-strings -emit-llvm %s -o - | FileCheck %s
//
-// CHECK: @.str = linker_private unnamed_addr constant [14 x i8] c"Hello, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
-// CHECK: @.str1 = linker_private unnamed_addr constant [7 x i8] c"yo joe\00", section "__TEXT,__cstring,cstring_literals", align 1
-// CHECK: @.str3 = linker_private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @.str = private unnamed_addr constant [14 x i8] c"Hello, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @.str1 = private unnamed_addr constant [7 x i8] c"yo joe\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @.str3 = private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
#define CFSTR __builtin___CFStringMakeConstantString
diff --git a/clang/test/CodeGen/darwin-string-literals.c b/clang/test/CodeGen/darwin-string-literals.c
index 621a46eb36f..e020685e8a0 100644
--- a/clang/test/CodeGen/darwin-string-literals.c
+++ b/clang/test/CodeGen/darwin-string-literals.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LSB %s
// CHECK-LSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
-// CHECK-LSB: @.str1 = linker_private unnamed_addr constant [8 x i8] c"string1\00"
+// CHECK-LSB: @.str1 = private unnamed_addr constant [8 x i8] c"string1\00"
// CHECK-LSB: @.str2 = internal unnamed_addr constant [18 x i16] [i16 104, i16 101, i16 108, i16 108, i16 111, i16 32, i16 8594, i16 32, i16 9731, i16 32, i16 8592, i16 32, i16 119, i16 111, i16 114, i16 108, i16 100, i16 0], section "__TEXT,__ustring", align 2
// CHECK-LSB: @.str4 = internal unnamed_addr constant [6 x i16] [i16 116, i16 101, i16 115, i16 116, i16 8482, i16 0], section "__TEXT,__ustring", align 2
@@ -9,7 +9,7 @@
// RUN: %clang_cc1 -triple powerpc-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-MSB %s
// CHECK-MSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
-// CHECK-MSB: @.str1 = linker_private unnamed_addr constant [8 x i8] c"string1\00"
+// CHECK-MSB: @.str1 = private unnamed_addr constant [8 x i8] c"string1\00"
// CHECK-MSB: @.str2 = internal unnamed_addr constant [18 x i16] [i16 104, i16 101, i16 108, i16 108, i16 111, i16 32, i16 8594, i16 32, i16 9731, i16 32, i16 8592, i16 32, i16 119, i16 111, i16 114, i16 108, i16 100, i16 0], section "__TEXT,__ustring", align 2
// CHECK-MSB: @.str4 = internal unnamed_addr constant [6 x i16] [i16 116, i16 101, i16 115, i16 116, i16 8482, i16 0], section "__TEXT,__ustring", align 2
OpenPOWER on IntegriCloud