diff options
Diffstat (limited to 'llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index d151de17896f..a9e27832917c 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/LTO/legacy/ThinLTOCodeGenerator.h" +#include "llvm/Support/CommandLine.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" @@ -292,7 +293,7 @@ std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, PM.add(createObjCARCContractPass()); // Setup the codegen now. - if (TM.addPassesToEmitFile(PM, OS, nullptr, TargetMachine::CGFT_ObjectFile, + if (TM.addPassesToEmitFile(PM, OS, nullptr, CGFT_ObjectFile, /* DisableVerify */ true)) report_fatal_error("Failed to setup codegen"); @@ -580,6 +581,7 @@ std::unique_ptr<ModuleSummaryIndex> ThinLTOCodeGenerator::linkCombinedIndex() { return CombinedIndex; } +namespace { struct IsExported { const StringMap<FunctionImporter::ExportSetTy> &ExportLists; const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols; @@ -588,11 +590,10 @@ struct IsExported { const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols) : ExportLists(ExportLists), GUIDPreservedSymbols(GUIDPreservedSymbols) {} - bool operator()(StringRef ModuleIdentifier, GlobalValue::GUID GUID) const { + bool operator()(StringRef ModuleIdentifier, ValueInfo VI) const { const auto &ExportList = ExportLists.find(ModuleIdentifier); - return (ExportList != ExportLists.end() && - ExportList->second.count(GUID)) || - GUIDPreservedSymbols.count(GUID); + return (ExportList != ExportLists.end() && ExportList->second.count(VI)) || + GUIDPreservedSymbols.count(VI.getGUID()); } }; @@ -610,6 +611,7 @@ struct IsPrevailing { return Prevailing->second == S; }; }; +} // namespace static void computeDeadSymbolsInIndex( ModuleSummaryIndex &Index, |