From 851853d8b71f5bf2f24705c8dc2df54b2af88d71 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 29 Mar 2010 02:38:51 +0000 Subject: [PATCH] Flip the switch to always get vtables from the VTT when necessary, I've verified that clang bootstraps with this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99800 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGClass.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index dfad33cc09..ebefba2411 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -1565,12 +1565,9 @@ CodeGenFunction::InitializeVTablePointer(BaseSubobject Base, // Compute the address point. llvm::Value *VTableAddressPoint; - - // FIXME: Always use the new vtable code once we know it works. - bool UseNewVTableCode = CGM.getLangOptions().DumpVtableLayouts; - + // Check if we need to use a vtable from the VTT. - if (UseNewVTableCode && CodeGenVTables::needsVTTParameter(CurGD) && + if (CodeGenVTables::needsVTTParameter(CurGD) && (RD->getNumVBases() || BaseIsMorallyVirtual)) { // Get the secondary vpointer index. uint64_t VirtualPointerIndex = @@ -1592,8 +1589,7 @@ CodeGenFunction::InitializeVTablePointer(BaseSubobject Base, // Compute where to store the address point. llvm::Value *VTableField; - if (UseNewVTableCode && - CodeGenVTables::needsVTTParameter(CurGD) && BaseIsMorallyVirtual) { + if (CodeGenVTables::needsVTTParameter(CurGD) && BaseIsMorallyVirtual) { // We need to use the virtual base offset offset because the virtual base // might have a different offset in the most derived class. VTableField = GetAddressOfBaseClass(LoadCXXThis(), VTableClass, RD, -- 2.40.0