summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-02-01 00:37:17 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-02-01 00:37:17 +0000
commit9fa5a67d3de00247e49c7c85b220789d0a34f523 (patch)
tree9f1e781d6983e22d5e5ea111845b4c9cd57ea752 /clang
parent4fff8f6cff1c8ec7c9d4b294c6ec19b7be120249 (diff)
downloadbcm5719-llvm-9fa5a67d3de00247e49c7c85b220789d0a34f523.tar.gz
bcm5719-llvm-9fa5a67d3de00247e49c7c85b220789d0a34f523.zip
Set visibility for available_externally globals. This is important for two reasons:
* llvm-link would complains about mismatched visibility * If we produce a relocation with an available_externally, it is good to know that it is hidden. llvm-svn: 124633
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
-rw-r--r--clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index b8f91b464dd..00db2616498 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -174,8 +174,7 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
// Set visibility for definitions.
NamedDecl::LinkageInfo LV = D->getLinkageAndVisibility();
- if (LV.visibilityExplicit() || !GV->hasAvailableExternallyLinkage())
- GV->setVisibility(GetLLVMVisibility(LV.visibility()));
+ GV->setVisibility(GetLLVMVisibility(LV.visibility()));
}
/// Set the symbol visibility of type information (vtable and RTTI)
diff --git a/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp b/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
index 7629b77c2ce..eb87ff15672 100644
--- a/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
+++ b/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
@@ -20,7 +20,7 @@ void test_X(X<int> xi, X<char> xc) {
xi.g();
// CHECK: declare void @_ZN1XIcE1fEv
xc.f();
- // CHECK: define available_externally void @_ZN1XIcE1gEv
+ // CHECK: define available_externally hidden void @_ZN1XIcE1gEv
xc.g();
}
OpenPOWER on IntegriCloud