diff options
author | Eric Liu <ioeric@google.com> | 2017-05-04 11:49:39 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2017-05-04 11:49:39 +0000 |
commit | f6039f255e0f85224c37a228a3cb6659b351796e (patch) | |
tree | 5042e47c514cad95e41a4fba95613227dcd0a2d2 /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | dd12594345b0e2156a524f88a43dfaeb5ab65f1d (diff) | |
download | bcm5719-llvm-f6039f255e0f85224c37a228a3cb6659b351796e.tar.gz bcm5719-llvm-f6039f255e0f85224c37a228a3cb6659b351796e.zip |
Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
This reverts commit r302108. This causes crash in clang bootstrap with LTO.
Contacted the auther in the original commit.
llvm-svn: 302140
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index 9dd712f9ca1..01e1b8168af 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -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.SummaryList) { + for (auto &GlobSummary : GlobalList.second) { 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.SummaryList) { + for (auto &Summary : GlobalList.second) { ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get(); } } @@ -49,10 +49,10 @@ void ModuleSummaryIndex::collectDefinedGVSummariesPerModule( GlobalValueSummary * ModuleSummaryIndex::getGlobalValueSummary(uint64_t ValueGUID, bool PerModuleIndex) const { - auto VI = getValueInfo(ValueGUID); - assert(VI && "GlobalValue not found in index"); - assert((!PerModuleIndex || VI.getSummaryList().size() == 1) && + auto SummaryList = findGlobalValueSummaryList(ValueGUID); + assert(SummaryList != end() && "GlobalValue not found in index"); + assert((!PerModuleIndex || SummaryList->second.size() == 1) && "Expected a single entry per global value in per-module index"); - auto &Summary = VI.getSummaryList()[0]; + auto &Summary = SummaryList->second[0]; return Summary.get(); } |