summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/ModuleSummaryIndex.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-16 07:02:16 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-16 07:02:16 +0000
commit1aafabf752a41bd0e0e565d6d02d7b43f4c5907e (patch)
treecc14de872cc7f10ecc39feef4681d46d171ee462 /llvm/lib/IR/ModuleSummaryIndex.cpp
parent71c8440e553b6208b199a4c9c98229ce88ba0c60 (diff)
downloadbcm5719-llvm-1aafabf752a41bd0e0e565d6d02d7b43f4c5907e.tar.gz
bcm5719-llvm-1aafabf752a41bd0e0e565d6d02d7b43f4c5907e.zip
ThinLTO: Move the ODR resolution to be based purely on the summary.
This is a requirement for the cache handling in D18494 Differential Revision: http://reviews.llvm.org/D18908 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266519
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index cc1e8a9657c..8ca5e27ea21 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -89,6 +89,19 @@ void ModuleSummaryIndex::collectDefinedFunctionsForModule(
}
}
+// Collect for each module the list of function it defines (GUID -> Summary).
+void ModuleSummaryIndex::collectDefinedGVSummariesPerModule(
+ StringMap<std::map<GlobalValue::GUID, GlobalValueSummary *>> &
+ Module2FunctionInfoMap) const {
+ for (auto &GlobalList : *this) {
+ auto GUID = GlobalList.first;
+ for (auto &GlobInfo : GlobalList.second) {
+ auto *Summary = GlobInfo->summary();
+ Module2FunctionInfoMap[Summary->modulePath()][GUID] = Summary;
+ }
+ }
+}
+
GlobalValueInfo *
ModuleSummaryIndex::getGlobalValueInfo(uint64_t ValueGUID,
bool PerModuleIndex) const {
OpenPOWER on IntegriCloud