]> granicus.if.org Git - clang/commitdiff
minor refactoring. No change otherwise.
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Aug 2009 18:46:38 +0000 (18:46 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Aug 2009 18:46:38 +0000 (18:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78582 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h

index 8f6cfc05ddcdc7b977f41341fa43115265ac65ce..417dcf748c704d3fd96551d18ad6a575546d79b5 100644 (file)
@@ -791,7 +791,18 @@ void CodeGenFunction::EmitClassMemberwiseCopy(
              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 
index 6135f65513d2be3fd958590cdc9246fecf485a70..309c76bea5ce0399fd9bb5f55d0fcb17639c4cc9 100644 (file)
@@ -251,9 +251,7 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD,
       else {
         assert(!ClassDecl->hasUserDeclaredConstructor() &&
                "bogus constructor is being synthesize");
-        StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
-        EmitCtorPrologue(CD);
-        FinishFunction();
+        SynthesizeDefaultConstructor(CD, FD, Fn, Args);
       }
     }
     
index 5b6826f57fba5ddde91162b93b16d57a3910c1ac..d3571e593b9f8ba27cdf73ac1f49f2eb2058f030 100644 (file)
@@ -373,6 +373,10 @@ public:
                                     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