minor refactoring. No change otherwise.

llvm-svn: 78582
This commit is contained in:
Fariborz Jahanian 2009-08-10 18:46:38 +00:00
parent 17410a4b92
commit 9d3405ceab
3 changed files with 17 additions and 4 deletions

View 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

View 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);
}
}

View 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