diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-27 20:02:53 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-27 20:02:53 +0000 |
commit | 327568ec139958def07e30f37a1bafac38819676 (patch) | |
tree | c0cd9e3d07f8eb42a809f497c066c39c90f5c227 /lib/CodeGen/CGVtable.cpp | |
parent | 379017f5350e5b01e241a5b35cec14e6318f00e6 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 1bf071c85d..af1db88221 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -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()), @@ -188,7 +190,8 @@ FinalOverriders::FinalOverriders(const CXXRecordDecl *MostDerivedClass) ComputeFinalOverriders(BaseSubobject(MostDerivedClass, 0), /*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; |