diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-03-29 18:24:19 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-03-29 18:24:19 +0000 |
commit | b703c77b033c48944aee437934cf15405fc113a8 (patch) | |
tree | 70f90f3086c20b538481310c54435c0e5b022583 /llvm/lib/Linker/LinkModules.cpp | |
parent | fee32cd9e29ad9437db49533e2f8b28ee9808c4a (diff) | |
download | bcm5719-llvm-b703c77b033c48944aee437934cf15405fc113a8.tar.gz bcm5719-llvm-b703c77b033c48944aee437934cf15405fc113a8.zip |
[ThinLTO] Remove post-pass metadata linking support
Since we have moved to a model where functions are imported in bulk from
each source module after making summary-based importing decisions, there
is no longer a need to link metadata as a postpass, and all users have
been removed.
This essentially reverts r255909 and follow-on fixes.
llvm-svn: 264763
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index c07c47ef687..07785d7a50f 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -39,11 +39,6 @@ class ModuleLinker { /// imported as declarations instead of definitions. DenseSet<const GlobalValue *> *GlobalsToImport; - /// Association between metadata value id and temporary metadata that - /// remains unmapped after function importing. Saved during function - /// importing and consumed during the metadata linking postpass. - DenseMap<unsigned, MDNode *> *ValIDToTempMDMap; - /// Used as the callback for lazy linking. /// The mover has just hit GV and we have to decide if it, and other members /// of the same comdat, should be linked. Every member to be linked is passed @@ -119,10 +114,9 @@ class ModuleLinker { public: ModuleLinker(IRMover &Mover, std::unique_ptr<Module> SrcM, unsigned Flags, - DenseSet<const GlobalValue *> *GlobalsToImport = nullptr, - DenseMap<unsigned, MDNode *> *ValIDToTempMDMap = nullptr) + DenseSet<const GlobalValue *> *GlobalsToImport = nullptr) : Mover(Mover), SrcM(std::move(SrcM)), Flags(Flags), - GlobalsToImport(GlobalsToImport), ValIDToTempMDMap(ValIDToTempMDMap) {} + GlobalsToImport(GlobalsToImport) {} bool run(); }; @@ -590,8 +584,7 @@ bool ModuleLinker::run() { if (Mover.move(std::move(SrcM), ValuesToLink.getArrayRef(), [this](GlobalValue &GV, IRMover::ValueAdder Add) { addLazyFor(GV, Add); - }, - ValIDToTempMDMap, false)) + })) return true; for (auto &P : Internalize) { GlobalValue *GV = DstM.getNamedValue(P.first()); @@ -604,24 +597,11 @@ bool ModuleLinker::run() { Linker::Linker(Module &M) : Mover(M) {} bool Linker::linkInModule(std::unique_ptr<Module> Src, unsigned Flags, - DenseSet<const GlobalValue *> *GlobalsToImport, - DenseMap<unsigned, MDNode *> *ValIDToTempMDMap) { - ModuleLinker ModLinker(Mover, std::move(Src), Flags, GlobalsToImport, - ValIDToTempMDMap); + DenseSet<const GlobalValue *> *GlobalsToImport) { + ModuleLinker ModLinker(Mover, std::move(Src), Flags, GlobalsToImport); return ModLinker.run(); } -bool Linker::linkInMetadata(std::unique_ptr<Module> Src, - DenseMap<unsigned, MDNode *> *ValIDToTempMDMap) { - SetVector<GlobalValue *> ValuesToLink; - if (Mover.move( - std::move(Src), ValuesToLink.getArrayRef(), - [this](GlobalValue &GV, IRMover::ValueAdder Add) { assert(false); }, - ValIDToTempMDMap, true)) - return true; - return false; -} - //===----------------------------------------------------------------------===// // LinkModules entrypoint. //===----------------------------------------------------------------------===// |