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);
|
unsigned Flags = Flags::None);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(Module *M, DiagnosticHandlerFunction DiagnosticHandler);
|
|
||||||
Module *Composite;
|
Module *Composite;
|
||||||
|
|
||||||
IdentifiedStructTypeSet IdentifiedStructTypes;
|
IdentifiedStructTypeSet IdentifiedStructTypes;
|
||||||
|
|
|
@ -2032,7 +2032,7 @@ bool Linker::IdentifiedStructTypeSet::hasType(StructType *Ty) {
|
||||||
return *I == Ty;
|
return *I == Ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
Linker::Linker(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
||||||
this->Composite = M;
|
this->Composite = M;
|
||||||
this->DiagnosticHandler = DiagnosticHandler;
|
this->DiagnosticHandler = DiagnosticHandler;
|
||||||
|
|
||||||
|
@ -2046,15 +2046,10 @@ void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Linker::Linker(Module *M, DiagnosticHandlerFunction DiagnosticHandler) {
|
Linker::Linker(Module *M)
|
||||||
init(M, DiagnosticHandler);
|
: Linker(M, [this](const DiagnosticInfo &DI) {
|
||||||
}
|
Composite->getContext().diagnose(DI);
|
||||||
|
}) {}
|
||||||
Linker::Linker(Module *M) {
|
|
||||||
init(M, [this](const DiagnosticInfo &DI) {
|
|
||||||
Composite->getContext().diagnose(DI);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void Linker::deleteModule() {
|
void Linker::deleteModule() {
|
||||||
delete Composite;
|
delete Composite;
|
||||||
|
|
Loading…
Reference in New Issue