summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index bac187bb3a3..0a9bbf2a7fc 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -1594,18 +1594,25 @@ bool ModuleLinker::run() {
return false;
}
-Linker::Linker(Module *M, DiagnosticHandlerFunction DiagnosticHandler)
- : Composite(M), DiagnosticHandler(DiagnosticHandler) {}
+void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
+ this->Composite = M;
+ this->DiagnosticHandler = DiagnosticHandler;
-Linker::Linker(Module *M)
- : Composite(M), DiagnosticHandler([this](const DiagnosticInfo &DI) {
- Composite->getContext().diagnose(DI);
- }) {
TypeFinder StructTypes;
StructTypes.run(*M, true);
IdentifiedStructTypes.insert(StructTypes.begin(), StructTypes.end());
}
+Linker::Linker(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
+ init(M, DiagnosticHandler);
+}
+
+Linker::Linker(Module *M) {
+ init(M, [this](const DiagnosticInfo &DI) {
+ Composite->getContext().diagnose(DI);
+ });
+}
+
Linker::~Linker() {
}
OpenPOWER on IntegriCloud