summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-02-24 20:31:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-02-24 20:31:44 +0000
commiteb4fd01f7a48b0e0d481e1bb724daed64a4f405f (patch)
tree5709cfbfcdeeb0c7d98b0d0dd49987f98ccafbec /clang
parent601a11edd44f73d69f4ce4a96f79d17631dfc469 (diff)
downloadbcm5719-llvm-eb4fd01f7a48b0e0d481e1bb724daed64a4f405f.tar.gz
bcm5719-llvm-eb4fd01f7a48b0e0d481e1bb724daed64a4f405f.zip
Use private linkage to avoid symbol conflicts in corner cases like the one
in PR9301. llvm-svn: 126422
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
-rw-r--r--clang/test/CodeGen/decl.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 844b1e37b0a..f4db01d2570 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -642,7 +642,7 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
// candidate nor a __block variable, emit it as a global instead.
if (CGM.getCodeGenOpts().MergeAllConstants && Ty.isConstQualified() &&
!NRVO && !isByRef) {
- EmitStaticVarDecl(D, llvm::GlobalValue::InternalLinkage);
+ EmitStaticVarDecl(D, llvm::GlobalValue::PrivateLinkage);
emission.Address = 0; // signal this condition to later callbacks
assert(emission.wasEmittedAsGlobal());
diff --git a/clang/test/CodeGen/decl.c b/clang/test/CodeGen/decl.c
index 7a9971ee181..5be42162361 100644
--- a/clang/test/CodeGen/decl.c
+++ b/clang/test/CodeGen/decl.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -w -emit-llvm < %s | FileCheck %s
-// CHECK: @test1.x = internal constant [12 x i32] [i32 1
+// CHECK: @test1.x = private constant [12 x i32] [i32 1
// CHECK: @test2.x = internal constant [13 x i32] [i32 1,
// CHECK: @test5w = global %0 { i32 2, [4 x i8] undef }
// CHECK: @test5y = global %union.test5u { double 7.300000e+0{{[0]*}}1 }
OpenPOWER on IntegriCloud