diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 931bcf0d23f..37ee7e8c53c 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -67,14 +67,14 @@ const char* LTOCodeGenerator::getVersionString() { LTOCodeGenerator::LTOCodeGenerator() : Context(getGlobalContext()), MergedModule(new Module("ld-temp.o", Context)), - IRLinker(MergedModule.get()) { + IRLinker(new Linker(MergedModule.get())) { initializeLTOPasses(); } LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr<LLVMContext> Context) : OwnedContext(std::move(Context)), Context(*OwnedContext), MergedModule(new Module("ld-temp.o", *OwnedContext)), - IRLinker(MergedModule.get()) { + IRLinker(new Linker(MergedModule.get())) { initializeLTOPasses(); } @@ -114,7 +114,7 @@ bool LTOCodeGenerator::addModule(LTOModule *Mod) { assert(&Mod->getModule().getContext() == &Context && "Expected module in same context"); - bool ret = IRLinker.linkInModule(&Mod->getModule()); + bool ret = IRLinker->linkInModule(&Mod->getModule()); const std::vector<const char *> &undefs = Mod->getAsmUndefinedRefs(); for (int i = 0, e = undefs.size(); i != e; ++i) @@ -130,7 +130,7 @@ void LTOCodeGenerator::setModule(std::unique_ptr<LTOModule> Mod) { AsmUndefinedRefs.clear(); MergedModule = Mod->takeModule(); - IRLinker.setModule(MergedModule.get()); + IRLinker = make_unique<Linker>(MergedModule.get()); const std::vector<const char*> &Undefs = Mod->getAsmUndefinedRefs(); for (int I = 0, E = Undefs.size(); I != E; ++I) diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index f745df56f9a..c57c70e322a 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -2071,10 +2071,6 @@ bool Linker::linkInModule(Module *Src, unsigned Flags, return RetCode; } -void Linker::setModule(Module *Dst) { - init(Dst, DiagnosticHandler); -} - //===----------------------------------------------------------------------===// // LinkModules entrypoint. //===----------------------------------------------------------------------===// |

