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
This commit is contained in:
parent
4fff8f6cff
commit
9fa5a67d3d
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue