diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/LTO/ThinLTOCodeGenerator.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
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, |
