mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-27 07:12:06 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7e463431d7
commit
d2a4b77f78
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user