Enable the new vtable layout code for vtables that aren't construction vtables. (This doesn't mean that we emit LLVM IR using it yet, it just means that it's running and hopefully not crashing or asserting).

llvm-svn: 97341
This commit is contained in:
Anders Carlsson 2010-02-27 20:02:53 +00:00
parent 9f19aaaa3a
commit 603d7d1910
1 changed files with 9 additions and 5 deletions

View File

@ -178,6 +178,8 @@ public:
void dump(llvm::raw_ostream &Out, BaseSubobject Base);
};
#define DUMP_OVERRIDERS 0
FinalOverriders::FinalOverriders(const CXXRecordDecl *MostDerivedClass)
: MostDerivedClass(MostDerivedClass),
Context(MostDerivedClass->getASTContext()),
@ -189,6 +191,7 @@ FinalOverriders::FinalOverriders(const CXXRecordDecl *MostDerivedClass)
/*BaseSubobjectIsVisitedVBase=*/false, Offsets);
VisitedVirtualBases.clear();
#if DUMP_OVERRIDERS
// And dump them (for now).
dump();
@ -203,6 +206,7 @@ FinalOverriders::FinalOverriders(const CXXRecordDecl *MostDerivedClass)
for (unsigned I = 0, E = OffsetVector.size(); I != E; ++I)
llvm::errs() << " " << I << " - " << OffsetVector[I] << '\n';
}
#endif
}
void FinalOverriders::AddOverriders(BaseSubobject Base,
@ -3268,11 +3272,11 @@ CGVtableInfo::GenerateVtable(llvm::GlobalVariable::LinkageTypes Linkage,
const CXXRecordDecl *LayoutClass,
const CXXRecordDecl *RD, uint64_t Offset,
AddressPointsMapTy& AddressPoints) {
if (GenerateDefinition && CGM.getLangOptions().DumpVtableLayouts &&
LayoutClass == RD) {
if (GenerateDefinition && LayoutClass == RD) {
VtableBuilder Builder(*this, RD);
Builder.dumpLayout(llvm::errs());
if (CGM.getLangOptions().DumpVtableLayouts)
Builder.dumpLayout(llvm::errs());
}
llvm::SmallString<256> OutName;