diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-17 20:51:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-17 20:51:01 +0000 |
commit | 5cb9c82a5da41a093679af1c18f60cb1be27ebf0 (patch) | |
tree | eca8802fa6059ecdb42e6b1e49662491109834ce /llvm/lib/Linker/LinkModules.cpp | |
parent | 557109377d0c766cb7bdeefd0cc524f377104806 (diff) | |
download | bcm5719-llvm-5cb9c82a5da41a093679af1c18f60cb1be27ebf0.tar.gz bcm5719-llvm-5cb9c82a5da41a093679af1c18f60cb1be27ebf0.zip |
Factor common code it Linker::init.
The TypeFinder was not being used in one of the constructors.
llvm-svn: 222172
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 19 |
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() { } |