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
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 3e828bf..a1ea6bf 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -699,7 +699,7 @@
}
}
-/// 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 @@
/// 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 @@
}
// FIXME. Do a built-in assignment of scalar data members.
}
+ FinishFunction();
}