[cfe-commits] r102880 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/CodeGen/CGClass.cpp lib/CodeGen/CGExprCXX.cpp lib/CodeGen/CodeGenFunction.h

Anders Carlsson andersca at mac.com
Sun May 2 16:01:10 PDT 2010


Author: andersca
Date: Sun May  2 18:01:10 2010
New Revision: 102880

URL: http://llvm.org/viewvc/llvm-project?rev=102880&view=rev
Log:
Pass the construction kind down to EmitCXXConstructorCall.

Modified:
    cfe/trunk/include/clang/AST/ExprCXX.h
    cfe/trunk/lib/CodeGen/CGClass.cpp
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=102880&r1=102879&r2=102880&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Sun May  2 18:01:10 2010
@@ -690,8 +690,8 @@
   
   /// \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;

Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=102880&r1=102879&r2=102880&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Sun May  2 18:01:10 2010
@@ -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.

Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=102880&r1=102879&r2=102880&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Sun May  2 18:01:10 2010
@@ -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());
 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=102880&r1=102879&r2=102880&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Sun May  2 18:01:10 2010
@@ -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);





More information about the cfe-commits mailing list