From 071d3af0de273b1079d79f7f979264f28d567373 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 1 Feb 2011 05:45:26 +0000 Subject: [PATCH] Revert 124633. The linker has been told how to merge available_externally. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124651 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 3 ++- test/CodeGenCXX/visibility-hidden-extern-templates.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 00db261649..b8f91b464d 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -174,7 +174,8 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV, // Set visibility for definitions. NamedDecl::LinkageInfo LV = D->getLinkageAndVisibility(); - GV->setVisibility(GetLLVMVisibility(LV.visibility())); + if (LV.visibilityExplicit() || !GV->hasAvailableExternallyLinkage()) + GV->setVisibility(GetLLVMVisibility(LV.visibility())); } /// Set the symbol visibility of type information (vtable and RTTI) diff --git a/test/CodeGenCXX/visibility-hidden-extern-templates.cpp b/test/CodeGenCXX/visibility-hidden-extern-templates.cpp index eb87ff1567..7629b77c2c 100644 --- a/test/CodeGenCXX/visibility-hidden-extern-templates.cpp +++ b/test/CodeGenCXX/visibility-hidden-extern-templates.cpp @@ -20,7 +20,7 @@ void test_X(X xi, X xc) { xi.g(); // CHECK: declare void @_ZN1XIcE1fEv xc.f(); - // CHECK: define available_externally hidden void @_ZN1XIcE1gEv + // CHECK: define available_externally void @_ZN1XIcE1gEv xc.g(); } -- 2.40.0