Refine construction vtables; they don't include bits that don't have

virtual bases unless they are morally virtual.

llvm-svn: 87071
This commit is contained in:
Mike Stump 2009-11-13 02:35:38 +00:00
parent 76a06074eb
commit fa81808a11
1 changed files with 5 additions and 0 deletions
clang/lib/CodeGen

View File

@ -585,6 +585,11 @@ public:
if (!RD->isDynamicClass()) if (!RD->isDynamicClass())
return 0; 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 ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase(); const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
const bool PrimaryBaseWasVirtual = Layout.getPrimaryBaseWasVirtual(); const bool PrimaryBaseWasVirtual = Layout.getPrimaryBaseWasVirtual();