forked from OSchip/llvm-project
Use a forwarding constructor instead of an init method.
llvm-svn: 254435
This commit is contained in:
parent
4808c6d064
commit
4dbdceb6fc
|
@ -93,7 +93,6 @@ public:
|
|||
unsigned Flags = Flags::None);
|
||||
|
||||
private:
|
||||
void init(Module *M, DiagnosticHandlerFunction DiagnosticHandler);
|
||||
Module *Composite;
|
||||
|
||||
IdentifiedStructTypeSet IdentifiedStructTypes;
|
||||
|
|
|
@ -2032,7 +2032,7 @@ bool Linker::IdentifiedStructTypeSet::hasType(StructType *Ty) {
|
|||
return *I == Ty;
|
||||
}
|
||||
|
||||
void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
||||
Linker::Linker(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
||||
this->Composite = M;
|
||||
this->DiagnosticHandler = DiagnosticHandler;
|
||||
|
||||
|
@ -2046,15 +2046,10 @@ void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
|||
}
|
||||
}
|
||||
|
||||
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(Module *M)
|
||||
: Linker(M, [this](const DiagnosticInfo &DI) {
|
||||
Composite->getContext().diagnose(DI);
|
||||
}) {}
|
||||
|
||||
void Linker::deleteModule() {
|
||||
delete Composite;
|
||||
|
|
Loading…
Reference in New Issue