From 9889652dbc10060cd604861ed2e5bc6719f845b0 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 6 Aug 2009 23:38:16 +0000 Subject: Patch toward synthesizing copy constructors. Work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78355 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 249764e9d9..8e53651c8e 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -645,7 +645,11 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName, else if (const CXXConstructorDecl *CD = dyn_cast(FD)) { const CXXRecordDecl *ClassDecl = cast(CD->getDeclContext()); - if (!ClassDecl->hasUserDeclaredConstructor()) + if (CD->isCopyConstructor(getContext())) { + if (!ClassDecl->hasUserDeclaredCopyConstructor()) + DeferredDeclsToEmit.push_back(D); + } + else if (!ClassDecl->hasUserDeclaredConstructor()) DeferredDeclsToEmit.push_back(D); } } -- cgit v1.2.3-18-g5258