aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-04-12 00:51:03 +0000
committerAnders Carlsson <andersca@mac.com>2010-04-12 00:51:03 +0000
commit80638c5e6395344c1e6096542b0ff3b8bfb2139e (patch)
tree1f1308ef963a4955430df1c0a3db5dbaf1805b00 /lib/CodeGen/CGClass.cpp
parent21b7323cd02867f2927f78011dbbe31206161da9 (diff)
Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r--lib/CodeGen/CGClass.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index 177e862304..7ca8f29b7e 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -782,15 +782,7 @@ static void EmitBaseInitializer(CodeGenFunction &CGF,
CXXRecordDecl *BaseClassDecl =
cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl());
- // FIXME: This method of determining whether a base is virtual is ridiculous;
- // it should be part of BaseInit.
- bool isBaseVirtual = false;
- for (CXXRecordDecl::base_class_const_iterator I = ClassDecl->vbases_begin(),
- E = ClassDecl->vbases_end(); I != E; ++I)
- if (I->getType()->getAs<RecordType>()->getDecl() == BaseClassDecl) {
- isBaseVirtual = true;
- break;
- }
+ bool isBaseVirtual = BaseInit->isBaseVirtual();
// The base constructor doesn't construct virtual bases.
if (CtorType == Ctor_Base && isBaseVirtual)
@@ -976,8 +968,6 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD,
llvm::SmallVector<CXXBaseOrMemberInitializer *, 8> MemberInitializers;
- // FIXME: Add vbase initialization
-
for (CXXConstructorDecl::init_const_iterator B = CD->init_begin(),
E = CD->init_end();
B != E; ++B) {