diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-09-26 01:57:00 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-09-26 01:57:00 +0000 |
commit | 9984d12729206c9c8d8009ed7eaab5be18c7ce89 (patch) | |
tree | 9eebce47b89de2e25d472ce8e5bd1e0b17333061 /lib/CodeGen/CGVTables.cpp | |
parent | e00fe697ccc755a1f4aca4dab2d47fcb40903947 (diff) |
Move vtable dumper call to VTableBuilder ctor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 44ac56a0aa..c753ce20a8 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -1000,6 +1000,9 @@ public: Overriders(MostDerivedClass, MostDerivedClassOffset, LayoutClass) { LayoutVTable(); + + if (Context.getLangOptions().DumpVTableLayouts) + dumpLayout(llvm::errs()); } uint64_t getNumThunks() const { @@ -3021,14 +3024,6 @@ void CodeGenVTables::EmitVTableDefinition(llvm::GlobalVariable *VTable, llvm::GlobalVariable::LinkageTypes Linkage, const CXXRecordDecl *RD) { - // Dump the vtable layout if necessary. - if (CGM.getLangOptions().DumpVTableLayouts) { - VTableBuilder Builder(VTContext, RD, CharUnits::Zero(), - /*MostDerivedClassIsVirtual=*/0, RD); - - Builder.dumpLayout(llvm::errs()); - } - const VTableLayout &VTLayout = VTContext.getVTableLayout(RD); // Create and set the initializer. @@ -3057,10 +3052,6 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, Base.getBaseOffset(), /*MostDerivedClassIsVirtual=*/BaseIsVirtual, RD); - // Dump the vtable layout if necessary. - if (CGM.getLangOptions().DumpVTableLayouts) - Builder.dumpLayout(llvm::errs()); - // Add the address points. AddressPoints.insert(Builder.address_points_begin(), Builder.address_points_end()); |