[cfe-commits] r102881 - in /cfe/trunk/lib/CodeGen: CGClass.cpp CGExprCXX.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Sun May 2 16:20:53 PDT 2010
Author: andersca
Date: Sun May 2 18:20:53 2010
New Revision: 102881
URL: http://llvm.org/viewvc/llvm-project?rev=102881&view=rev
Log:
Revert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall instead.
Modified:
cfe/trunk/lib/CodeGen/CGClass.cpp
cfe/trunk/lib/CodeGen/CGExprCXX.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=102881&r1=102880&r2=102881&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Sun May 2 18:20:53 2010
@@ -1085,7 +1085,7 @@
{
CXXTemporariesCleanupScope Scope(*this);
- EmitCXXConstructorCall(D, CXXConstructExpr::CK_Complete, Address,
+ EmitCXXConstructorCall(D, Ctor_Complete, /*ForVirtualBase=*/false, Address,
ArgBeg, ArgEnd);
}
@@ -1223,13 +1223,10 @@
void
CodeGenFunction::EmitCXXConstructorCall(const CXXConstructorDecl *D,
- CXXConstructExpr::ConstructionKind Kind,
+ CXXCtorType Type, bool ForVirtualBase,
llvm::Value *This,
CallExpr::const_arg_iterator ArgBeg,
CallExpr::const_arg_iterator ArgEnd) {
- CXXCtorType Type =
- (Kind == CXXConstructExpr::CK_Complete) ? Ctor_Complete : Ctor_Base;
-
if (D->isTrivial()) {
if (ArgBeg == ArgEnd) {
// Trivial default constructor, no codegen required.
Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=102881&r1=102880&r2=102881&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Sun May 2 18:20:53 2010
@@ -321,10 +321,17 @@
EmitCXXAggrConstructorCall(CD, Array, BaseAddrPtr,
E->arg_begin(), E->arg_end());
}
- else
+ else {
+ CXXCtorType Type =
+ (E->getConstructionKind() == CXXConstructExpr::CK_Complete)
+ ? Ctor_Complete : Ctor_Base;
+ bool ForVirtualBase =
+ E->getConstructionKind() == CXXConstructExpr::CK_VirtualBase;
+
// Call the constructor.
- EmitCXXConstructorCall(CD, E->getConstructionKind(), Dest,
+ EmitCXXConstructorCall(CD, Type, ForVirtualBase, Dest,
E->arg_begin(), E->arg_end());
+ }
}
static CharUnits CalculateCookiePadding(ASTContext &Ctx, QualType ElementType) {
@@ -468,8 +475,8 @@
QualType AllocType = E->getAllocatedType();
if (CXXConstructorDecl *Ctor = E->getConstructor()) {
- CGF.EmitCXXConstructorCall(Ctor, CXXConstructExpr::CK_Complete, NewPtr,
- E->constructor_arg_begin(),
+ CGF.EmitCXXConstructorCall(Ctor, Ctor_Complete, /*ForVirtualBase=*/false,
+ NewPtr, E->constructor_arg_begin(),
E->constructor_arg_end());
return;
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=102881&r1=102880&r2=102881&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Sun May 2 18:20:53 2010
@@ -815,9 +815,8 @@
void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
CXXCtorType CtorType,
const FunctionArgList &Args);
- void EmitCXXConstructorCall(const CXXConstructorDecl *D,
- CXXConstructExpr::ConstructionKind ConstructKind,
- llvm::Value *This,
+ void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type,
+ bool ForVirtualBase, llvm::Value *This,
CallExpr::const_arg_iterator ArgBeg,
CallExpr::const_arg_iterator ArgEnd);
More information about the cfe-commits
mailing list