diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-08 19:31:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-08 19:31:03 +0000 |
commit | 8c241a2844428eb1589c7b77fc6c1888295a2045 (patch) | |
tree | 83712342af3ff9b35cb7269ae1ad48bb7ce7667b /lib/CodeGen/CGCXX.cpp | |
parent | 8045c7393bc83060f812d0f7b1221edbc767407c (diff) |
Refactoring of copy ctor ir-gen. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 3e828bf9ac..a1ea6bf76a 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -699,7 +699,7 @@ void CodeGenFunction::EmitClassMemberwiseCopy( } } -/// EmitCopyCtorBody - This routine implicitly defines body of a copy +/// 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 /// copy of its subobjects. The order of copying is the same as the order @@ -714,11 +714,14 @@ void CodeGenFunction::EmitClassMemberwiseCopy( /// Virtual base class subobjects shall be copied only once by the /// implicitly-defined copy constructor -void CodeGenFunction::EmitCopyCtorBody(const CXXConstructorDecl *CD, +void CodeGenFunction::SynthesizeCXXCopyConstructor(const CXXConstructorDecl *CD, + const FunctionDecl *FD, + llvm::Function *Fn, const FunctionArgList &Args) { const CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(CD->getDeclContext()); assert(!ClassDecl->hasUserDeclaredCopyConstructor() && - "EmitCopyCtorBody - copy constructor has definition already"); + "SynthesizeCXXCopyConstructor - copy constructor has definition already"); + StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation()); FunctionArgList::const_iterator i = Args.begin(); const VarDecl *ThisArg = i->first; @@ -759,6 +762,7 @@ void CodeGenFunction::EmitCopyCtorBody(const CXXConstructorDecl *CD, } // FIXME. Do a built-in assignment of scalar data members. } + FinishFunction(); } |