diff options
author | Teresa Johnson <tejohnson@google.com> | 2018-11-29 17:02:59 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2018-11-29 17:02:59 +0000 |
commit | b162442217a1863093c945784e7f7ab006a891e3 (patch) | |
tree | f07775107d21e04e5a25cdafa298bb8cf614d823 /lib | |
parent | 184b170da56120eef5e13f518248ef6a9a02b8ac (diff) | |
download | clang-b162442217a1863093c945784e7f7ab006a891e3.tar.gz |
[ThinLTO] Allow importing of multiple symbols with same GUID
Summary:
The is the clang side of the fix in D55047, to handle the case where
two different modules have local variables with the same GUID because
they had the same source file name at compilation time. Allow multiple
symbols with the same GUID to be imported, and test that this case works
with the distributed backend path.
Depends on D55047.
Reviewers: evgeny777
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D55048
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 61c68d117e..f746bc2f88 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -1155,15 +1155,14 @@ static void runThinLTOBackend(ModuleSummaryIndex *CombinedIndex, Module *M, continue; auto GUID = GlobalList.first; - assert(GlobalList.second.SummaryList.size() == 1 && - "Expected individual combined index to have one summary per GUID"); - auto &Summary = GlobalList.second.SummaryList[0]; - // Skip the summaries for the importing module. These are included to - // e.g. record required linkage changes. - if (Summary->modulePath() == M->getModuleIdentifier()) - continue; - // Add an entry to provoke importing by thinBackend. - ImportList[Summary->modulePath()].insert(GUID); + for (auto &Summary : GlobalList.second.SummaryList) { + // Skip the summaries for the importing module. These are included to + // e.g. record required linkage changes. + if (Summary->modulePath() == M->getModuleIdentifier()) + continue; + // Add an entry to provoke importing by thinBackend. + ImportList[Summary->modulePath()].insert(GUID); + } } std::vector<std::unique_ptr<llvm::MemoryBuffer>> OwnedImports; |