Pass the construction kind down to EmitCXXConstructorCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index 0f1b015..27eb1d7 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -1085,7 +1085,8 @@
{
CXXTemporariesCleanupScope Scope(*this);
- EmitCXXConstructorCall(D, Ctor_Complete, Address, ArgBeg, ArgEnd);
+ EmitCXXConstructorCall(D, CXXConstructExpr::CK_Complete, Address,
+ ArgBeg, ArgEnd);
}
EmitBlock(ContinueBlock);
@@ -1222,10 +1223,13 @@
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.
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 1f25f2d..d4e26cf 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -323,9 +323,7 @@
}
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 @@
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());
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 5ecc9a2..f98cbb4 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -815,7 +815,8 @@
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);