forked from OSchip/llvm-project
[lib/LTO] Simplify. No functional change intended.
llvm-svn: 280503
This commit is contained in:
parent
30e2067e3e
commit
41bfd6bd6c
|
@ -374,21 +374,16 @@ void LTOCodeGenerator::preserveDiscardableGVs(
|
|||
}
|
||||
llvm::Type *i8PTy = llvm::Type::getInt8PtrTy(TheModule.getContext());
|
||||
auto mayPreserveGlobal = [&](GlobalValue &GV) {
|
||||
if (!GV.isDiscardableIfUnused() || GV.isDeclaration())
|
||||
if (!GV.isDiscardableIfUnused() || GV.isDeclaration() ||
|
||||
!mustPreserveGV(GV))
|
||||
return;
|
||||
if (!mustPreserveGV(GV))
|
||||
return;
|
||||
if (GV.hasAvailableExternallyLinkage()) {
|
||||
emitWarning(
|
||||
if (GV.hasAvailableExternallyLinkage())
|
||||
return emitWarning(
|
||||
(Twine("Linker asked to preserve available_externally global: '") +
|
||||
GV.getName() + "'").str());
|
||||
return;
|
||||
}
|
||||
if (GV.hasInternalLinkage()) {
|
||||
emitWarning((Twine("Linker asked to preserve internal global: '") +
|
||||
if (GV.hasInternalLinkage())
|
||||
return emitWarning((Twine("Linker asked to preserve internal global: '") +
|
||||
GV.getName() + "'").str());
|
||||
return;
|
||||
}
|
||||
UsedValuesSet.insert(ConstantExpr::getBitCast(&GV, i8PTy));
|
||||
};
|
||||
for (auto &GV : TheModule)
|
||||
|
|
Loading…
Reference in New Issue