Pass the construction kind down to EmitCXXConstructorCall.

llvm-svn: 102880
This commit is contained in:
Anders Carlsson 2010-05-02 23:01:10 +00:00
parent bcc066b659
commit 4c638f1217
4 changed files with 12 additions and 9 deletions

View File

@ -690,8 +690,8 @@ public:
/// \brief Determines whether this constructor is actually constructing
/// a base class (rather than a complete object).
bool isBaseInitialization() const {
return ConstructKind != CK_Complete;
ConstructionKind getConstructionKind() const {
return (ConstructionKind)ConstructKind;
}
void setConstructionKind(ConstructionKind CK) {
ConstructKind = CK;

View File

@ -1085,7 +1085,8 @@ CodeGenFunction::EmitCXXAggrConstructorCall(const CXXConstructorDecl *D,
{
CXXTemporariesCleanupScope Scope(*this);
EmitCXXConstructorCall(D, Ctor_Complete, Address, ArgBeg, ArgEnd);
EmitCXXConstructorCall(D, CXXConstructExpr::CK_Complete, Address,
ArgBeg, ArgEnd);
}
EmitBlock(ContinueBlock);
@ -1222,10 +1223,13 @@ CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D,
void
CodeGenFunction::EmitCXXConstructorCall(const CXXConstructorDecl *D,
CXXCtorType Type,
CXXConstructExpr::ConstructionKind Kind,
llvm::Value *This,
CallExpr::const_arg_iterator ArgBeg,
CallExpr::const_arg_iterator ArgEnd) {
CXXCtorType Type =
(Kind == CXXConstructExpr::CK_Complete) ? Ctor_Complete : Ctor_Base;
if (D->isTrivial()) {
if (ArgBeg == ArgEnd) {
// Trivial default constructor, no codegen required.

View File

@ -323,9 +323,7 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest,
}
else
// Call the constructor.
EmitCXXConstructorCall(CD,
E->isBaseInitialization()? Ctor_Base : Ctor_Complete,
Dest,
EmitCXXConstructorCall(CD, E->getConstructionKind(), Dest,
E->arg_begin(), E->arg_end());
}
@ -470,7 +468,7 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E,
QualType AllocType = E->getAllocatedType();
if (CXXConstructorDecl *Ctor = E->getConstructor()) {
CGF.EmitCXXConstructorCall(Ctor, Ctor_Complete, NewPtr,
CGF.EmitCXXConstructorCall(Ctor, CXXConstructExpr::CK_Complete, NewPtr,
E->constructor_arg_begin(),
E->constructor_arg_end());

View File

@ -815,7 +815,8 @@ public:
void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
CXXCtorType CtorType,
const FunctionArgList &Args);
void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type,
void EmitCXXConstructorCall(const CXXConstructorDecl *D,
CXXConstructExpr::ConstructionKind ConstructKind,
llvm::Value *This,
CallExpr::const_arg_iterator ArgBeg,
CallExpr::const_arg_iterator ArgEnd);