diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-30 23:22:00 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-30 23:22:00 +0000 |
commit | 6f14c73087ba24f0f48ba07afb3cc6466d468acc (patch) | |
tree | e571b08b49070b339b49c15ddd1de8a438ed235f /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 16f58557d234c0f6ac2abf66216006060a1c501f (diff) | |
download | bcm5719-llvm-6f14c73087ba24f0f48ba07afb3cc6466d468acc.tar.gz bcm5719-llvm-6f14c73087ba24f0f48ba07afb3cc6466d468acc.zip |
Synthesize the default constructor which has not
been declared as needed.
llvm-svn: 77641
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index bb53dcc39e3..708100e2a05 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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()); |