}
}
-/// 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
/// 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;
}
// FIXME. Do a built-in assignment of scalar data members.
}
+ FinishFunction();
}
if (CD->isCopyConstructor(getContext())) {
assert(!ClassDecl->hasUserDeclaredCopyConstructor() &&
"bogus constructor is being synthesize");
- StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
- EmitCopyCtorBody(CD, Args);
- FinishFunction();
+ SynthesizeCXXCopyConstructor(CD, FD, Fn, Args);
}
else {
assert(!ClassDecl->hasUserDeclaredConstructor() &&
void EmitCtorPrologue(const CXXConstructorDecl *CD);
- void EmitCopyCtorBody(const CXXConstructorDecl *CD,
- const FunctionArgList &Args);
+ void SynthesizeCXXCopyConstructor(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