mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-20 19:04:10 -04:00
Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
with a fix for the clang backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -22,7 +22,7 @@ void ModuleSummaryIndex::collectDefinedFunctionsForModule(
|
||||
StringRef ModulePath, GVSummaryMapTy &GVSummaryMap) const {
|
||||
for (auto &GlobalList : *this) {
|
||||
auto GUID = GlobalList.first;
|
||||
for (auto &GlobSummary : GlobalList.second) {
|
||||
for (auto &GlobSummary : GlobalList.second.SummaryList) {
|
||||
auto *Summary = dyn_cast_or_null<FunctionSummary>(GlobSummary.get());
|
||||
if (!Summary)
|
||||
// Ignore global variable, focus on functions
|
||||
@@ -40,7 +40,7 @@ void ModuleSummaryIndex::collectDefinedGVSummariesPerModule(
|
||||
StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries) const {
|
||||
for (auto &GlobalList : *this) {
|
||||
auto GUID = GlobalList.first;
|
||||
for (auto &Summary : GlobalList.second) {
|
||||
for (auto &Summary : GlobalList.second.SummaryList) {
|
||||
ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get();
|
||||
}
|
||||
}
|
||||
@@ -49,10 +49,10 @@ void ModuleSummaryIndex::collectDefinedGVSummariesPerModule(
|
||||
GlobalValueSummary *
|
||||
ModuleSummaryIndex::getGlobalValueSummary(uint64_t ValueGUID,
|
||||
bool PerModuleIndex) const {
|
||||
auto SummaryList = findGlobalValueSummaryList(ValueGUID);
|
||||
assert(SummaryList != end() && "GlobalValue not found in index");
|
||||
assert((!PerModuleIndex || SummaryList->second.size() == 1) &&
|
||||
auto VI = getValueInfo(ValueGUID);
|
||||
assert(VI && "GlobalValue not found in index");
|
||||
assert((!PerModuleIndex || VI.getSummaryList().size() == 1) &&
|
||||
"Expected a single entry per global value in per-module index");
|
||||
auto &Summary = SummaryList->second[0];
|
||||
auto &Summary = VI.getSummaryList()[0];
|
||||
return Summary.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user