summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-27 20:02:53 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-27 20:02:53 +0000
commit603d7d19100d57f2bac79a6dc52166000d83ff59 (patch)
tree9ae8a3c8572f86b71494ccdf29c6a30eda56de3c /clang/lib
parent9f19aaaa3af132bc434539f58e7d624c3784c8d0 (diff)
downloadbcm5719-llvm-603d7d19100d57f2bac79a6dc52166000d83ff59.tar.gz
bcm5719-llvm-603d7d19100d57f2bac79a6dc52166000d83ff59.zip
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
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index 1bf071c85d5..af1db882219 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud