[cfe-commits] r78582 - in /cfe/trunk/lib/CodeGen: CGCXX.cpp CodeGenFunction.cpp CodeGenFunction.h

Fariborz Jahanian fjahanian at apple.com
Mon Aug 10 11:46:38 PDT 2009


Author: fjahanian
Date: Mon Aug 10 13:46:38 2009
New Revision: 78582

URL: http://llvm.org/viewvc/llvm-project?rev=78582&view=rev
Log:
minor refactoring. No change otherwise.

Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=78582&r1=78581&r2=78582&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Mon Aug 10 13:46:38 2009
@@ -791,7 +791,18 @@
              Callee, CallArgs, BaseCopyCtor);
   }
 }
-  
+
+/// SynthesizeDefaultConstructor - synthesize a default constructor
+void 
+CodeGenFunction::SynthesizeDefaultConstructor(const CXXConstructorDecl *CD,
+                                              const FunctionDecl *FD,
+                                              llvm::Function *Fn,
+                                              const FunctionArgList &Args) {
+  StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
+  EmitCtorPrologue(CD);
+  FinishFunction();
+}
+
 /// SynthesizeCXXCopyConstructor - This routine implicitly defines body of a copy
 /// constructor, in accordance with section 12.8 (p7 and p8) of C++03
 /// The implicitly-defined copy constructor for class X performs a memberwise 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=78582&r1=78581&r2=78582&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Aug 10 13:46:38 2009
@@ -251,9 +251,7 @@
       else {
         assert(!ClassDecl->hasUserDeclaredConstructor() &&
                "bogus constructor is being synthesize");
-        StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
-        EmitCtorPrologue(CD);
-        FinishFunction();
+        SynthesizeDefaultConstructor(CD, FD, Fn, Args);
       }
     }
     

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=78582&r1=78581&r2=78582&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Mon Aug 10 13:46:38 2009
@@ -373,6 +373,10 @@
                                     const FunctionDecl *FD,
                                     llvm::Function *Fn,
                                     const FunctionArgList &Args);
+  void SynthesizeDefaultConstructor(const CXXConstructorDecl *CD,
+                                    const FunctionDecl *FD,
+                                    llvm::Function *Fn,
+                                    const FunctionArgList &Args);
   
   /// EmitDtorEpilogue - Emit all code that comes at the end of class's
   /// destructor. This is to call destructors on members and base classes 





More information about the cfe-commits mailing list