From 1aafabf752a41bd0e0e565d6d02d7b43f4c5907e Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 16 Apr 2016 07:02:16 +0000 Subject: 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 llvm-svn: 266519 --- llvm/lib/IR/ModuleSummaryIndex.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp') 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> & + 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 { -- cgit v1.2.3