[cfe-commits] r87071 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Mike Stump
mrs at apple.com
Thu Nov 12 18:35:38 PST 2009
Author: mrs
Date: Thu Nov 12 20:35:38 2009
New Revision: 87071
URL: http://llvm.org/viewvc/llvm-project?rev=87071&view=rev
Log:
Refine construction vtables; they don't include bits that don't have
virtual bases unless they are morally virtual.
Modified:
cfe/trunk/lib/CodeGen/CGVtable.cpp
Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=87071&r1=87070&r2=87071&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Thu Nov 12 20:35:38 2009
@@ -585,6 +585,11 @@
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();
More information about the cfe-commits
mailing list