diff options
author | Mike Stump <mrs@apple.com> | 2009-11-13 02:35:38 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-11-13 02:35:38 +0000 |
commit | fa81808a11310e895a52ee375229689f47bbed01 (patch) | |
tree | 017b05f2d2a7107364de700224729db31eaf188e /clang/lib | |
parent | 76a06074eb3b1bbaf4f72fca817af3eb31a889d0 (diff) | |
download | bcm5719-llvm-fa81808a11310e895a52ee375229689f47bbed01.tar.gz bcm5719-llvm-fa81808a11310e895a52ee375229689f47bbed01.zip |
Refine construction vtables; they don't include bits that don't have
virtual bases unless they are morally virtual.
llvm-svn: 87071
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 9f45343d6be..b12a48ad94b 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/lib/CodeGen/CGVtable.cpp @@ -585,6 +585,11 @@ public: if (!RD->isDynamicClass()) return 0; + // Construction vtable don't need parts that have no virtual bases and + // aren't morally virtual. + if ((LayoutClass != Class) && RD->getNumVBases() == 0 && !MorallyVirtual) + return 0; + const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase(); const bool PrimaryBaseWasVirtual = Layout.getPrimaryBaseWasVirtual(); |