[cfe-commits] r99867 - in /cfe/trunk: lib/CodeGen/CGClass.cpp test/CodeGenCXX/copy-constructor-synthesis.cpp
Anders Carlsson
andersca at mac.com
Mon Mar 29 20:30:08 PDT 2010
Author: andersca
Date: Mon Mar 29 22:30:08 2010
New Revision: 99867
URL: http://llvm.org/viewvc/llvm-project?rev=99867&view=rev
Log:
Use the new function in EmitClassAggrMemberwiseCopy, fixing the same assert as seen in PR6628 but for arrays this time.
Modified:
cfe/trunk/lib/CodeGen/CGClass.cpp
cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp
Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=99867&r1=99866&r2=99867&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Mon Mar 29 22:30:08 2010
@@ -401,22 +401,9 @@
if (BitwiseCopy)
EmitAggregateCopy(Dest, Src, Ty);
else if (CXXConstructorDecl *BaseCopyCtor =
- BaseClassDecl->getCopyConstructor(getContext(), 0)) {
- llvm::Value *Callee = CGM.GetAddrOfCXXConstructor(BaseCopyCtor,
- Ctor_Complete);
- CallArgList CallArgs;
- // Push the this (Dest) ptr.
- CallArgs.push_back(std::make_pair(RValue::get(Dest),
- BaseCopyCtor->getThisType(getContext())));
+ BaseClassDecl->getCopyConstructor(getContext(), 0))
+ EmitCopyCtorCall(*this, BaseCopyCtor, Ctor_Complete, Dest, 0, Src);
- // Push the Src ptr.
- CallArgs.push_back(std::make_pair(RValue::get(Src),
- BaseCopyCtor->getParamDecl(0)->getType()));
- const FunctionProtoType *FPT
- = BaseCopyCtor->getType()->getAs<FunctionProtoType>();
- EmitCall(CGM.getTypes().getFunctionInfo(CallArgs, FPT),
- Callee, ReturnValueSlot(), CallArgs, BaseCopyCtor);
- }
EmitBlock(ContinueBlock);
// Emit the increment of the loop counter.
Modified: cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp?rev=99867&r1=99866&r2=99867&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-constructor-synthesis.cpp Mon Mar 29 22:30:08 2010
@@ -128,6 +128,7 @@
struct B : A {
A a1;
A a2;
+ A a[10];
};
// Force the copy constructor to be synthesized.
More information about the cfe-commits
mailing list