diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-05-24 19:12:48 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-05-24 19:12:48 +0000 |
commit | 4ae5ce7e8eb959e1138e8ad2de04c3db7f8dc574 (patch) | |
tree | d7f136e85d9292222a6636ddd2c85e87b0c5dc78 /llvm/lib/LTO/ThinLTOCodeGenerator.cpp | |
parent | 10e25748b0ae1e26ded232f22bd1596d3a64e11c (diff) | |
download | llvm-4ae5ce7e8eb959e1138e8ad2de04c3db7f8dc574.zip llvm-4ae5ce7e8eb959e1138e8ad2de04c3db7f8dc574.tar.gz llvm-4ae5ce7e8eb959e1138e8ad2de04c3db7f8dc574.tar.bz2 |
[ThinLTO] Handle empty exports list for module.
We might have an empty exports list for a module and shouldn't assert
when checking if a symbol is exported.
llvm-svn: 270600
Diffstat (limited to 'llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index d746d47..5c74d72 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -586,8 +586,9 @@ static void resolveWeakForLinkerInIndex( auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) { const auto &ExportList = ExportLists.find(ModuleIdentifier); - assert(ExportList != ExportLists.end() && "Missing export list for module"); - return ExportList->second.count(GUID) || GUIDPreservedSymbols.count(GUID); + return (ExportList != ExportLists.end() && + ExportList->second.count(GUID)) || + GUIDPreservedSymbols.count(GUID); }; auto recordNewLinkage = [&](StringRef ModuleIdentifier, @@ -827,8 +828,9 @@ void ThinLTOCodeGenerator::internalize(Module &TheModule, // Internalization auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) { const auto &ExportList = ExportLists.find(ModuleIdentifier); - assert(ExportList != ExportLists.end() && "Missing export list for module"); - return ExportList->second.count(GUID) || GUIDPreservedSymbols.count(GUID); + return (ExportList != ExportLists.end() && + ExportList->second.count(GUID)) || + GUIDPreservedSymbols.count(GUID); }; thinLTOInternalizeAndPromoteInIndex(Index, isExported); thinLTOInternalizeModule(TheModule, @@ -928,8 +930,9 @@ void ThinLTOCodeGenerator::run() { auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) { const auto &ExportList = ExportLists.find(ModuleIdentifier); - assert(ExportList != ExportLists.end() && "Missing export list for module"); - return ExportList->second.count(GUID) || GUIDPreservedSymbols.count(GUID); + return (ExportList != ExportLists.end() && + ExportList->second.count(GUID)) || + GUIDPreservedSymbols.count(GUID); }; // Use global summary-based analysis to identify symbols that can be |