summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp10
-rw-r--r--llvm/lib/Linker/LinkModules.cpp10
2 files changed, 6 insertions, 14 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index b0dae74c13d..25c150b2784 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -65,9 +65,10 @@ const char* LTOCodeGenerator::getVersionString() {
}
LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
- : Context(Context),
- MergedModule(new Module("ld-temp.o", Context)),
- IRLinker(new Linker(*MergedModule)) {
+ : Context(Context), MergedModule(new Module("ld-temp.o", Context)),
+ IRLinker(new Linker(*MergedModule, [this](const DiagnosticInfo &DI) {
+ MergedModule->getContext().diagnose(DI);
+ })) {
initializeLTOPasses();
}
@@ -123,7 +124,8 @@ void LTOCodeGenerator::setModule(std::unique_ptr<LTOModule> Mod) {
AsmUndefinedRefs.clear();
MergedModule = Mod->takeModule();
- IRLinker = make_unique<Linker>(*MergedModule);
+ IRLinker =
+ make_unique<Linker>(*MergedModule, IRLinker->getDiagnosticHandler());
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 55ab1824740..88b8e443c48 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -2030,11 +2030,6 @@ Linker::Linker(Module &M, DiagnosticHandlerFunction DiagnosticHandler)
}
}
-Linker::Linker(Module &M)
- : Linker(M, [this](const DiagnosticInfo &DI) {
- Composite.getContext().diagnose(DI);
- }) {}
-
bool Linker::linkInModule(Module &Src, unsigned Flags,
const FunctionInfoIndex *Index,
DenseSet<const GlobalValue *> *FunctionsToImport) {
@@ -2061,11 +2056,6 @@ bool Linker::linkModules(Module &Dest, Module &Src,
return L.linkInModule(Src, Flags);
}
-bool Linker::linkModules(Module &Dest, Module &Src, unsigned Flags) {
- Linker L(Dest);
- return L.linkInModule(Src, Flags);
-}
-
//===----------------------------------------------------------------------===//
// C API.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud