summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-04-05 00:40:16 +0000
committerTeresa Johnson <tejohnson@google.com>2016-04-05 00:40:16 +0000
commitfb7c7644965d5d28b5bea1d3061c1703ce925a07 (patch)
tree3d3dd57c0b347be38e936660d52f06b4f74f63cf /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent86d8d876401e3e3166c1da794cd256461b76f931 (diff)
downloadbcm5719-llvm-fb7c7644965d5d28b5bea1d3061c1703ce925a07.tar.gz
bcm5719-llvm-fb7c7644965d5d28b5bea1d3061c1703ce925a07.zip
[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. llvm-svn: 265370
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 09e5220b919..39f2d6ae333 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -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;
OpenPOWER on IntegriCloud