Handle constructors and destructors a bit more uniformly in CodeGen.

There were code paths that are duplicated for constructors and destructors just
because we have both CXXCtorType and CXXDtorsTypes.

This patch introduces an unified enum and reduces code deplication a bit.

llvm-svn: 217383
This commit is contained in:
Rafael Espindola
2014-09-08 16:01:27 +00:00
parent 6a2f62cbd3
commit 8d2a19b478
9 changed files with 161 additions and 173 deletions

View File

@@ -1758,7 +1758,8 @@ CodeGenFunction::EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
}
llvm::Value *Callee = CGM.GetAddrOfCXXConstructor(Ctor, CtorType);
EmitCall(CGM.getTypes().arrangeCXXConstructorDeclaration(Ctor, CtorType),
EmitCall(CGM.getTypes()
.arrangeCXXStructorDeclaration(Ctor, getFromCtorType(CtorType)),
Callee, ReturnValueSlot(), DelegateArgs, Ctor);
}