mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-17 23:20:20 +00:00
FunctionImport: Simplify function llvm::thinLTOInternalizeModule. NFCI.
llvm-svn: 302595
This commit is contained in:
parent
8532e51cf2
commit
948f554dba
@ -610,8 +610,7 @@ void llvm::thinLTOInternalizeModule(Module &TheModule,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Lookup the linkage recorded in the summaries during global analysis.
|
// Lookup the linkage recorded in the summaries during global analysis.
|
||||||
const auto &GS = DefinedGlobals.find(GV.getGUID());
|
auto GS = DefinedGlobals.find(GV.getGUID());
|
||||||
GlobalValue::LinkageTypes Linkage;
|
|
||||||
if (GS == DefinedGlobals.end()) {
|
if (GS == DefinedGlobals.end()) {
|
||||||
// Must have been promoted (possibly conservatively). Find original
|
// Must have been promoted (possibly conservatively). Find original
|
||||||
// name so that we can access the correct summary and see if it can
|
// name so that we can access the correct summary and see if it can
|
||||||
@ -623,7 +622,7 @@ void llvm::thinLTOInternalizeModule(Module &TheModule,
|
|||||||
std::string OrigId = GlobalValue::getGlobalIdentifier(
|
std::string OrigId = GlobalValue::getGlobalIdentifier(
|
||||||
OrigName, GlobalValue::InternalLinkage,
|
OrigName, GlobalValue::InternalLinkage,
|
||||||
TheModule.getSourceFileName());
|
TheModule.getSourceFileName());
|
||||||
const auto &GS = DefinedGlobals.find(GlobalValue::getGUID(OrigId));
|
GS = DefinedGlobals.find(GlobalValue::getGUID(OrigId));
|
||||||
if (GS == DefinedGlobals.end()) {
|
if (GS == DefinedGlobals.end()) {
|
||||||
// Also check the original non-promoted non-globalized name. In some
|
// Also check the original non-promoted non-globalized name. In some
|
||||||
// cases a preempted weak value is linked in as a local copy because
|
// cases a preempted weak value is linked in as a local copy because
|
||||||
@ -631,15 +630,11 @@ void llvm::thinLTOInternalizeModule(Module &TheModule,
|
|||||||
// In that case, since it was originally not a local value, it was
|
// In that case, since it was originally not a local value, it was
|
||||||
// recorded in the index using the original name.
|
// recorded in the index using the original name.
|
||||||
// FIXME: This may not be needed once PR27866 is fixed.
|
// FIXME: This may not be needed once PR27866 is fixed.
|
||||||
const auto &GS = DefinedGlobals.find(GlobalValue::getGUID(OrigName));
|
GS = DefinedGlobals.find(GlobalValue::getGUID(OrigName));
|
||||||
assert(GS != DefinedGlobals.end());
|
assert(GS != DefinedGlobals.end());
|
||||||
Linkage = GS->second->linkage();
|
|
||||||
} else {
|
|
||||||
Linkage = GS->second->linkage();
|
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
Linkage = GS->second->linkage();
|
return !GlobalValue::isLocalLinkage(GS->second->linkage());
|
||||||
return !GlobalValue::isLocalLinkage(Linkage);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: See if we can just internalize directly here via linkage changes
|
// FIXME: See if we can just internalize directly here via linkage changes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user