aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-07-30 23:22:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-07-30 23:22:00 +0000
commitc7ff8e19081c2e974f05f66c4fa9b40750fc655f (patch)
tree49195cd331e71c0ab6ae6cf2ad245e1f180846d4 /lib/CodeGen/CodeGenFunction.cpp
parentb197572cf1cd70a817a1f546478cb2cb9112c48e (diff)
Synthesize the default constructor which has not
been declared as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index bb53dcc39e..708100e2a0 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -238,7 +238,17 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD,
EmitDtorEpilogue(DD);
FinishFunction(S->getRBracLoc());
}
-
+ else
+ if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(FD)) {
+ assert(
+ !cast<CXXRecordDecl>(CD->getDeclContext())->
+ hasUserDeclaredConstructor() &&
+ "bogus constructor is being synthesize");
+ StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
+ EmitCtorPrologue(CD);
+ FinishFunction();
+ }
+
// Destroy the 'this' declaration.
if (CXXThisDecl)
CXXThisDecl->Destroy(getContext());