diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-26 05:53:12 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-26 05:53:12 +0000 |
commit | 6fffc64dd237eca847e5eeaed17b2b00621f8841 (patch) | |
tree | 8be9b4e2a4e456c314fd06b4df34395351666f39 /clang/lib | |
parent | 0a29a05f029afce490db12f9fc00c3129fa8b701 (diff) | |
download | bcm5719-llvm-6fffc64dd237eca847e5eeaed17b2b00621f8841.tar.gz bcm5719-llvm-6fffc64dd237eca847e5eeaed17b2b00621f8841.zip |
Don't initialize virtual pointers for primary bases, they've already been initialized.
llvm-svn: 99612
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 8a084926e76..4999d620b5e 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -1601,6 +1601,13 @@ void CodeGenFunction::InitializeVtablePtrs(BaseSubobject Base, CXXRecordDecl *BaseDecl = cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl()); + + // We don't need to initialize vtable pointers for primary bases, unless + // they're virtual. + if (!Layout.getPrimaryBaseWasVirtual() && + Layout.getPrimaryBase() == BaseDecl) + continue; + uint64_t BaseOffset = Base.getBaseOffset() + Layout.getBaseClassOffset(BaseDecl); |