[ThinLTO] Simplify code. NFC

This commit is contained in:
evgeny 2019-11-19 15:51:25 +03:00
parent f6ffe6fc9d
commit ef5e3b85ee
1 changed files with 4 additions and 5 deletions

View File

@ -386,11 +386,10 @@ static bool isWeakObjectWithRWAccess(GlobalValueSummary *GVS) {
}
static void thinLTOInternalizeAndPromoteGUID(
GlobalValueSummaryList &GVSummaryList, ValueInfo VI,
function_ref<bool(StringRef, ValueInfo)> isExported,
ValueInfo VI, function_ref<bool(StringRef, ValueInfo)> isExported,
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing) {
for (auto &S : GVSummaryList) {
for (auto &S : VI.getSummaryList()) {
if (isExported(S->modulePath(), VI)) {
if (GlobalValue::isLocalLinkage(S->linkage()))
S->setLinkage(GlobalValue::ExternalLinkage);
@ -422,8 +421,8 @@ void llvm::thinLTOInternalizeAndPromoteInIndex(
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing) {
for (auto &I : Index)
thinLTOInternalizeAndPromoteGUID(
I.second.SummaryList, Index.getValueInfo(I), isExported, isPrevailing);
thinLTOInternalizeAndPromoteGUID(Index.getValueInfo(I), isExported,
isPrevailing);
}
// Requires a destructor for std::vector<InputModule>.