[cfe-commits] r99861 - in /cfe/trunk: lib/CodeGen/CGVtable.cpp test/CodeGenCXX/vtable-linkage.cpp

Anders Carlsson andersca at mac.com
Mon Mar 29 19:21:54 PDT 2010


Author: andersca
Date: Mon Mar 29 21:21:54 2010
New Revision: 99861

URL: http://llvm.org/viewvc/llvm-project?rev=99861&view=rev
Log:
Flip the switch and use the new vtable layout code for everything. I've verified that this passes a self-host but I'll let the bots self host as well before removing the now dead code.

Modified:
    cfe/trunk/lib/CodeGen/CGVtable.cpp
    cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=99861&r1=99860&r2=99861&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Mon Mar 29 21:21:54 2010
@@ -3617,7 +3617,7 @@
   return I->second;
 }
 
-static bool UseNewVTableCode = false;
+static bool UseNewVTableCode = true;
 
 uint64_t
 CodeGenVTables::getAddressPoint(BaseSubobject Base, const CXXRecordDecl *RD) {

Modified: cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp?rev=99861&r1=99860&r2=99861&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp Mon Mar 29 21:21:54 2010
@@ -84,54 +84,54 @@
 // CHECK: @_ZTV1B = external constant
 
 // C has no key function, so its vtable should have weak_odr linkage.
+// CHECK: @_ZTV1C = weak_odr constant
 // CHECK: @_ZTS1C = weak_odr constant
 // CHECK: @_ZTI1C = weak_odr constant
-// CHECK: @_ZTV1C = weak_odr constant
 
 // D has a key function that is defined in this translation unit so its vtable is
 // defined in the translation unit.
+// CHECK: @_ZTV1D = constant
 // CHECK: @_ZTS1D = constant
 // CHECK: @_ZTI1D = constant
-// CHECK: @_ZTV1D = constant
 
 // E<char> is an explicit specialization with a key function defined
 // in this translation unit, so its vtable should have external
 // linkage.
+// CHECK: @_ZTV1EIcE = constant
 // CHECK: @_ZTS1EIcE = constant
 // CHECK: @_ZTI1EIcE = constant
-// CHECK: @_ZTV1EIcE = constant
 
 // E<short> is an explicit template instantiation with a key function
 // defined in this translation unit, so its vtable should have
 // weak_odr linkage.
+// CHECK: @_ZTV1EIsE = weak_odr constant
 // CHECK: @_ZTS1EIsE = weak_odr constant
 // CHECK: @_ZTI1EIsE = weak_odr constant
-// CHECK: @_ZTV1EIsE = weak_odr constant
 
 // F<short> is an explicit template instantiation without a key
 // function, so its vtable should have weak_odr linkage
+// CHECK: @_ZTV1FIsE = weak_odr constant
 // CHECK: @_ZTS1FIsE = weak_odr constant
 // CHECK: @_ZTI1FIsE = weak_odr constant
-// CHECK: @_ZTV1FIsE = weak_odr constant
 
 // E<long> is an implicit template instantiation with a key function
 // defined in this translation unit, so its vtable should have
 // weak_odr linkage.
+// CHECK: @_ZTV1EIlE = weak_odr constant
 // CHECK: @_ZTS1EIlE = weak_odr constant
 // CHECK: @_ZTI1EIlE = weak_odr constant
-// CHECK: @_ZTV1EIlE = weak_odr constant
 
 // F<long> is an implicit template instantiation with no key function,
 // so its vtable should have weak_odr linkage.
+// CHECK: @_ZTV1FIlE = weak_odr constant
 // CHECK: @_ZTS1FIlE = weak_odr constant
 // CHECK: @_ZTI1FIlE = weak_odr constant
-// CHECK: @_ZTV1FIlE = weak_odr constant
 
 // F<int> is an explicit template instantiation declaration without a
 // key function, so its vtable should have weak_odr linkage.
+// CHECK: @_ZTV1FIiE = weak_odr constant
 // CHECK: @_ZTS1FIiE = weak_odr constant
 // CHECK: @_ZTI1FIiE = weak_odr constant
-// CHECK: @_ZTV1FIiE = weak_odr constant
 
 // E<int> is an explicit template instantiation declaration. It has a
 // key function that is not instantiated, so we should only reference
@@ -140,14 +140,14 @@
 
 // The anonymous struct for e has no linkage, so the vtable should have
 // internal linkage.
+// CHECK: @"_ZTV3$_0" = internal constant
 // CHECK: @"_ZTS3$_0" = internal constant
 // CHECK: @"_ZTI3$_0" = internal constant
-// CHECK: @"_ZTV3$_0" = internal constant
 
 // The A vtable should have internal linkage since it is inside an anonymous 
 // namespace.
+// CHECK: @_ZTVN12_GLOBAL__N_11AE = internal constant
 // CHECK: @_ZTSN12_GLOBAL__N_11AE = internal constant
 // CHECK: @_ZTIN12_GLOBAL__N_11AE = internal constant
-// CHECK: @_ZTVN12_GLOBAL__N_11AE = internal constant
 
 





More information about the cfe-commits mailing list