-fvisibility=hidden: Hide init symbols, TypeInfos and vtables too if the associated aggregate isn't exported (#3129)

This commit is contained in:
Martin Kinkelin 2019-08-20 01:41:26 +02:00 committed by GitHub
parent ceee37dda2
commit c1725809c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 85 additions and 16 deletions

View file

@ -146,7 +146,7 @@ public:
auto &initZ = ir->getInitSymbol();
auto initGlobal = llvm::cast<LLGlobalVariable>(initZ);
initZ = irs->setGlobalVarInitializer(initGlobal, ir->getDefaultInit());
setLinkage(decl, initGlobal);
setLinkageAndVisibility(decl, initGlobal);
// emit typeinfo
if (!ir->suppressTypeInfo()) {
@ -198,7 +198,7 @@ public:
auto &initZ = ir->getInitSymbol();
auto initGlobal = llvm::cast<LLGlobalVariable>(initZ);
initZ = irs->setGlobalVarInitializer(initGlobal, ir->getDefaultInit());
setLinkage(decl, initGlobal);
setLinkageAndVisibility(decl, initGlobal);
llvm::GlobalVariable *vtbl = ir->getVtblSymbol();
defineGlobal(vtbl, ir->getVtblInit(), decl);