summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-10 18:46:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-10 18:46:38 +0000
commit9d3405ceab027b9276b8ec7142247376dc3e07ce (patch)
tree69756c19015dad5171470f6bd76098de10c3d2a9
parent17410a4b92847af4a214082633c38791e243751e (diff)
downloadbcm5719-llvm-9d3405ceab027b9276b8ec7142247376dc3e07ce.tar.gz
bcm5719-llvm-9d3405ceab027b9276b8ec7142247376dc3e07ce.zip
minor refactoring. No change otherwise.
llvm-svn: 78582
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp13
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h4
3 files changed, 17 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index 8f6cfc05ddc..417dcf748c7 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/lib/CodeGen/CGCXX.cpp
@@ -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
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 6135f65513d..309c76bea5c 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -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);
}
}
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 5b6826f57fb..d3571e593b9 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -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
OpenPOWER on IntegriCloud