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 | 92774d1051f5315052fd63d39673c42c9c03a1c4 (patch) | |
tree | c9189daa65b6105459ae7077913ecdb150414577 /lib/CodeGen/CGVtable.cpp | |
parent | 4cde626be951472ceac7ca429c343c479ff26c87 (diff) |
Refine construction vtables; they don't include bits that don't have
virtual bases unless they are morally virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 9f45343d6b..b12a48ad94 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/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(); |