[cfe-commits] r97341 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Sat Feb 27 12:02:53 PST 2010
Author: andersca
Date: Sat Feb 27 14:02:53 2010
New Revision: 97341
URL: http://llvm.org/viewvc/llvm-project?rev=97341&view=rev
Log:
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).
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=97341&r1=97340&r2=97341&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sat Feb 27 14:02:53 2010
@@ -178,6 +178,8 @@
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 @@
ComputeFinalOverriders(BaseSubobject(MostDerivedClass, 0),
/*BaseSubobjectIsVisitedVBase=*/false, Offsets);
VisitedVirtualBases.clear();
-
+
+#if DUMP_OVERRIDERS
// And dump them (for now).
dump();
@@ -203,6 +206,7 @@
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 @@
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;
More information about the cfe-commits
mailing list