mirror of
https://github.com/RPCSX/llvm.git
synced 2026-01-31 01:05:23 +01:00
[ThinLTO] Refactor some common code into getGlobalValueInfo method (NFC)
Refactor common code that queries the ModuleSummaryIndex for a value's GlobalValueInfo struct into getGlobalValueInfo helper methods, which will also be used by D18763. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265370 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5824,12 +5824,7 @@ std::error_code ModuleSummaryIndexBitcodeReader::parseEntireSummary() {
|
||||
CalleeInfo(CallsiteCount, ProfileCount));
|
||||
}
|
||||
GlobalValue::GUID GUID = getGUIDFromValueId(ValueID);
|
||||
auto InfoList = TheIndex->findGlobalValueInfoList(GUID);
|
||||
assert(InfoList != TheIndex->end() &&
|
||||
"Expected VST parse to create GlobalValueInfo entry");
|
||||
assert(InfoList->second.size() == 1 &&
|
||||
"Expected a single GlobalValueInfo per GUID in module");
|
||||
auto &Info = InfoList->second[0];
|
||||
auto *Info = TheIndex->getGlobalValueInfo(GUID);
|
||||
assert(!Info->summary() && "Expected a single summary per VST entry");
|
||||
Info->setSummary(std::move(FS));
|
||||
break;
|
||||
@@ -5848,12 +5843,7 @@ std::error_code ModuleSummaryIndexBitcodeReader::parseEntireSummary() {
|
||||
FS->addRefEdge(RefGUID);
|
||||
}
|
||||
GlobalValue::GUID GUID = getGUIDFromValueId(ValueID);
|
||||
auto InfoList = TheIndex->findGlobalValueInfoList(GUID);
|
||||
assert(InfoList != TheIndex->end() &&
|
||||
"Expected VST parse to create GlobalValueInfo entry");
|
||||
assert(InfoList->second.size() == 1 &&
|
||||
"Expected a single GlobalValueInfo per GUID in module");
|
||||
auto &Info = InfoList->second[0];
|
||||
auto *Info = TheIndex->getGlobalValueInfo(GUID);
|
||||
assert(!Info->summary() && "Expected a single summary per VST entry");
|
||||
Info->setSummary(std::move(FS));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user