mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Factor common code it Linker::init.
The TypeFinder was not being used in one of the constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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() {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user