]> granicus.if.org Git - clang/commitdiff
Pass the construction kind down to EmitCXXConstructorCall.
authorAnders Carlsson <andersca@mac.com>
Sun, 2 May 2010 23:01:10 +0000 (23:01 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 2 May 2010 23:01:10 +0000 (23:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGExprCXX.cpp
lib/CodeGen/CodeGenFunction.h

index 250e09af53d2a8b156f92df8ff476e006b5099df..bef58277723d77d703b07e699a885a25b12cae85 100644 (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;
index 0f1b015966f11a6fcbeda54ae3052e5ff8deef1e..27eb1d764317686ffda5310f1e94c19947a2676d 100644 (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.
index 1f25f2de26799b02a9ea2201536f54a776fef152..d4e26cf506d99b9f37984f1aab4de83c3e6d20f8 100644 (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());
 
index 5ecc9a20c38d4d8a334eacb5f396cbbb56b6617b..f98cbb4306935daf1e79f0bf88d78f60cdc8d08a 100644 (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);