[cfe-commits] r124089 - in /cfe/trunk: lib/CodeGen/CGRTTI.cpp lib/CodeGen/CodeGenModule.cpp test/CodeGenCXX/exceptions-no-rtti.cpp test/CodeGenCXX/key-function-vtable.cpp test/CodeGenCXX/mangle-subst-std.cpp test/CodeGenCXX/rtti-linkage.cpp test/CodeGenCXX/virt-template-vtable.cpp test/CodeGenCXX/visibility.cpp test/CodeGenCXX/vtable-key-function.cpp test/CodeGenCXX/vtable-linkage.cpp test/CodeGenCXX/vtt-layout.cpp test/CodeGenObjCXX/rtti.mm test/SemaCXX/typeid-ref.cpp

Anders Carlsson andersca at mac.com
Sun Jan 23 16:46:19 PST 2011


Author: andersca
Date: Sun Jan 23 18:46:19 2011
New Revision: 124089

URL: http://llvm.org/viewvc/llvm-project?rev=124089&view=rev
Log:
Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr.

This fixes PR6996.


Modified:
    cfe/trunk/lib/CodeGen/CGRTTI.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/test/CodeGenCXX/exceptions-no-rtti.cpp
    cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp
    cfe/trunk/test/CodeGenCXX/mangle-subst-std.cpp
    cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
    cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp
    cfe/trunk/test/CodeGenCXX/visibility.cpp
    cfe/trunk/test/CodeGenCXX/vtable-key-function.cpp
    cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp
    cfe/trunk/test/CodeGenCXX/vtt-layout.cpp
    cfe/trunk/test/CodeGenObjCXX/rtti.mm
    cfe/trunk/test/SemaCXX/typeid-ref.cpp

Modified: cfe/trunk/lib/CodeGen/CGRTTI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRTTI.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRTTI.cpp Sun Jan 23 18:46:19 2011
@@ -355,10 +355,10 @@
         return CodeGenModule::getVTableLinkage(RD);
     }
 
-    return llvm::GlobalValue::WeakODRLinkage;
+    return llvm::GlobalValue::LinkOnceODRLinkage;
   }
 
-  return llvm::GlobalValue::WeakODRLinkage;
+  return llvm::GlobalValue::LinkOnceODRLinkage;
 }
 
 // CanUseSingleInheritance - Return whether the given record decl has a "single, 
@@ -640,7 +640,7 @@
                           /*ForRTTI*/ true, /*ForDefinition*/ true);
   else if (Hidden || 
            (CGM.getCodeGenOpts().HiddenWeakVTables &&
-            Linkage == llvm::GlobalValue::WeakODRLinkage)) {
+            Linkage == llvm::GlobalValue::LinkOnceODRLinkage)) {
     GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
   }
   GV->setUnnamedAddr(true);

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sun Jan 23 18:46:19 2011
@@ -210,7 +210,7 @@
   // in CGVTables.cpp.
 
   // Preconditions.
-  if (GV->getLinkage() != llvm::GlobalVariable::WeakODRLinkage ||
+  if (GV->getLinkage() != llvm::GlobalVariable::LinkOnceODRLinkage ||
       GV->getVisibility() != llvm::GlobalVariable::DefaultVisibility)
     return;
 
@@ -1053,19 +1053,21 @@
       case TSK_Undeclared:
       case TSK_ExplicitSpecialization:
         if (KeyFunction->isInlined())
-          return llvm::GlobalVariable::WeakODRLinkage;
+          return llvm::GlobalVariable::LinkOnceODRLinkage;
         
         return llvm::GlobalVariable::ExternalLinkage;
         
       case TSK_ImplicitInstantiation:
+        return llvm::GlobalVariable::LinkOnceODRLinkage;
+
       case TSK_ExplicitInstantiationDefinition:
         return llvm::GlobalVariable::WeakODRLinkage;
-        
+  
       case TSK_ExplicitInstantiationDeclaration:
         // FIXME: Use available_externally linkage. However, this currently
         // breaks LLVM's build due to undefined symbols.
         //      return llvm::GlobalVariable::AvailableExternallyLinkage;
-        return llvm::GlobalVariable::WeakODRLinkage;
+        return llvm::GlobalVariable::LinkOnceODRLinkage;
     }
   }
   
@@ -1073,6 +1075,8 @@
   case TSK_Undeclared:
   case TSK_ExplicitSpecialization:
   case TSK_ImplicitInstantiation:
+    return llvm::GlobalVariable::LinkOnceODRLinkage;
+
   case TSK_ExplicitInstantiationDefinition:
     return llvm::GlobalVariable::WeakODRLinkage;
     
@@ -1080,11 +1084,11 @@
     // FIXME: Use available_externally linkage. However, this currently
     // breaks LLVM's build due to undefined symbols.
     //   return llvm::GlobalVariable::AvailableExternallyLinkage;
-    return llvm::GlobalVariable::WeakODRLinkage;
+    return llvm::GlobalVariable::LinkOnceODRLinkage;
   }
   
   // Silence GCC warning.
-  return llvm::GlobalVariable::WeakODRLinkage;
+  return llvm::GlobalVariable::LinkOnceODRLinkage;
 }
 
 CharUnits CodeGenModule::GetTargetTypeStoreSize(const llvm::Type *Ty) const {

Modified: cfe/trunk/test/CodeGenCXX/exceptions-no-rtti.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions-no-rtti.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions-no-rtti.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions-no-rtti.cpp Sun Jan 23 18:46:19 2011
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -fno-rtti -fexceptions %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
 
-// CHECK: @_ZTIN5test11AE = weak_odr unnamed_addr constant
-// CHECK: @_ZTIN5test11BE = weak_odr unnamed_addr constant
-// CHECK: @_ZTIN5test11CE = weak_odr unnamed_addr constant
-// CHECK: @_ZTIN5test11DE = weak_odr unnamed_addr constant
-// CHECK: @_ZTIPN5test11DE = weak_odr unnamed_addr constant {{.*}} @_ZTIN5test11DE
+// CHECK: @_ZTIN5test11AE = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTIN5test11BE = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTIN5test11CE = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTIN5test11DE = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTIPN5test11DE = linkonce_odr unnamed_addr constant {{.*}} @_ZTIN5test11DE
 
 // PR6974: this shouldn't crash
 namespace test0 {

Modified: cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp Sun Jan 23 18:46:19 2011
@@ -43,9 +43,9 @@
 
 // FIXME: The checks are extremely difficult to get right when the globals
 // aren't alphabetized
-// CHECK: @_ZTV2X1 = weak_odr unnamed_addr constant
+// CHECK: @_ZTV2X1 = linkonce_odr unnamed_addr constant
 // CHECK: @_ZTV5testa = unnamed_addr constant [3 x i8*] [i8* null
-// CHECK: @_ZTV5testc = weak_odr unnamed_addr constant [3 x i8*] [i8* null
+// CHECK: @_ZTV5testc = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null
 // CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal unnamed_addr constant [3 x i8*] [i8* null
-// CHECK: @_ZTV5teste = weak_odr unnamed_addr constant [3 x i8*] [i8* null
-// CHECK: @_ZTV5testb = weak_odr unnamed_addr constant [3 x i8*] [i8* null
+// CHECK: @_ZTV5teste = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null
+// CHECK: @_ZTV5testb = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null

Modified: cfe/trunk/test/CodeGenCXX/mangle-subst-std.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-subst-std.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-subst-std.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-subst-std.cpp Sun Jan 23 18:46:19 2011
@@ -3,14 +3,14 @@
 // Check mangling of Vtables, VTTs, and construction vtables that
 // involve standard substitutions.
 
-// CHECK: @_ZTVSd = weak_odr unnamed_addr constant 
+// CHECK: @_ZTVSd = linkonce_odr unnamed_addr constant 
 // CHECK: @_ZTCSd0_Si = internal constant 
 // CHECK: @_ZTCSd16_So = internal constant
-// CHECK: @_ZTTSd = weak_odr unnamed_addr constant
-// CHECK: @_ZTVSo = weak_odr unnamed_addr constant
-// CHECK: @_ZTTSo = weak_odr unnamed_addr constant
-// CHECK: @_ZTVSi = weak_odr unnamed_addr constant
-// CHECK: @_ZTTSi = weak_odr unnamed_addr constant
+// CHECK: @_ZTTSd = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTVSo = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTTSo = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTVSi = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTTSi = linkonce_odr unnamed_addr constant
 namespace std {
   struct A { A(); };
   

Modified: cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp Sun Jan 23 18:46:19 2011
@@ -4,10 +4,10 @@
 #include <typeinfo>
 
 // CHECK-WITH-HIDDEN: _ZTSFN12_GLOBAL__N_11DEvE = internal constant
-// CHECK-WITH-HIDDEN: @_ZTSPK2T4 = weak_odr hidden constant 
-// CHECK-WITH-HIDDEN: @_ZTS2T4 = weak_odr hidden constant 
-// CHECK-WITH-HIDDEN: @_ZTI2T4 = weak_odr hidden unnamed_addr constant 
-// CHECK-WITH-HIDDEN: @_ZTIPK2T4 = weak_odr hidden unnamed_addr constant 
+// CHECK-WITH-HIDDEN: @_ZTSPK2T4 = linkonce_odr hidden constant 
+// CHECK-WITH-HIDDEN: @_ZTS2T4 = linkonce_odr hidden constant 
+// CHECK-WITH-HIDDEN: @_ZTI2T4 = linkonce_odr hidden unnamed_addr constant 
+// CHECK-WITH-HIDDEN: @_ZTIPK2T4 = linkonce_odr hidden unnamed_addr constant 
 
 // CHECK: _ZTSP1C = internal constant
 // CHECK: _ZTS1C = internal constant
@@ -24,8 +24,8 @@
 // CHECK: _ZTSM1CPS_ = internal constant
 // CHECK: _ZTIM1CPS_ = internal unnamed_addr constant
 // CHECK: _ZTSM1A1C = internal constant
-// CHECK: _ZTS1A = weak_odr constant
-// CHECK: _ZTI1A = weak_odr hidden unnamed_addr constant
+// CHECK: _ZTS1A = linkonce_odr constant
+// CHECK: _ZTI1A = linkonce_odr hidden unnamed_addr constant
 // CHECK: _ZTIM1A1C = internal unnamed_addr constant
 // CHECK: _ZTSM1AP1C = internal constant
 // CHECK: _ZTIM1AP1C = internal unnamed_addr constant
@@ -37,24 +37,24 @@
 // CHECK: _ZTIFN12_GLOBAL__N_11DEvE = internal unnamed_addr constant
 // CHECK: _ZTSFvN12_GLOBAL__N_11DEE = internal constant
 // CHECK: _ZTIFvN12_GLOBAL__N_11DEE = internal unnamed_addr constant
-// CHECK: _ZTSPFvvE = weak_odr constant
-// CHECK: _ZTSFvvE = weak_odr constant
-// CHECK: _ZTIFvvE = weak_odr hidden unnamed_addr constant
-// CHECK: _ZTIPFvvE = weak_odr hidden unnamed_addr constant
+// CHECK: _ZTSPFvvE = linkonce_odr constant
+// CHECK: _ZTSFvvE = linkonce_odr constant
+// CHECK: _ZTIFvvE = linkonce_odr hidden unnamed_addr constant
+// CHECK: _ZTIPFvvE = linkonce_odr hidden unnamed_addr constant
 // CHECK: _ZTSN12_GLOBAL__N_11EE = internal constant
 // CHECK: _ZTIN12_GLOBAL__N_11EE = internal unnamed_addr constant
-// CHECK: _ZTSA10_i = weak_odr constant
-// CHECK: _ZTIA10_i = weak_odr hidden unnamed_addr constant
-// CHECK: _ZTI1TILj0EE = weak_odr unnamed_addr constant
+// CHECK: _ZTSA10_i = linkonce_odr constant
+// CHECK: _ZTIA10_i = linkonce_odr hidden unnamed_addr constant
+// CHECK: _ZTI1TILj0EE = linkonce_odr unnamed_addr constant
 // CHECK: _ZTI1TILj1EE = weak_odr unnamed_addr constant
 // CHECK: _ZTI1TILj2EE = external constant
 // CHECK: _ZTS1B = constant
 // CHECK: _ZTI1B = unnamed_addr constant
-// CHECK: _ZTS1F = weak_odr constant
+// CHECK: _ZTS1F = linkonce_odr constant
 
 // CHECK: _ZTIN12_GLOBAL__N_11DE to
 
-// A has no key function, so its RTTI data should be weak_odr.
+// A has no key function, so its RTTI data should be linkonce_odr.
 struct A { };
 
 // B has a key function defined in the translation unit, so the RTTI data should
@@ -90,7 +90,7 @@
 };
 
 // F has a key function defined in the translation unit, but it is inline so the RTTI
-// data should be emitted with weak_odr linkage.
+// data should be emitted with linkonce_odr linkage.
 struct F {
   virtual void f();
 };

Modified: cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp Sun Jan 23 18:46:19 2011
@@ -16,7 +16,7 @@
 template class A<short>;
 
 
-// CHECK: @_ZTV1B = weak_odr unnamed_addr constant
+// CHECK: @_ZTV1B = linkonce_odr unnamed_addr constant
 // CHECK: @_ZTV1AIlE = weak_odr unnamed_addr constant
 // CHECK: @_ZTV1AIsE = weak_odr unnamed_addr constant
-// CHECK: @_ZTV1AIiE = weak_odr unnamed_addr constant
+// CHECK: @_ZTV1AIiE = linkonce_odr unnamed_addr constant

Modified: cfe/trunk/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/visibility.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/visibility.cpp Sun Jan 23 18:46:19 2011
@@ -28,7 +28,7 @@
 // CHECK-HIDDEN: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr hidden global i64
 // CHECK-HIDDEN: @_ZTTN6Test161AIcEE = external unnamed_addr constant
 // CHECK-HIDDEN: @_ZTVN6Test161AIcEE = external unnamed_addr constant
-// CHECK: @_ZTVN5Test63fooE = weak_odr hidden unnamed_addr constant 
+// CHECK: @_ZTVN5Test63fooE = linkonce_odr hidden unnamed_addr constant 
 
 namespace Test1 {
   // CHECK: define hidden void @_ZN5Test11fEv

Modified: cfe/trunk/test/CodeGenCXX/vtable-key-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-key-function.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-key-function.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-key-function.cpp Sun Jan 23 18:46:19 2011
@@ -9,7 +9,7 @@
 
 // A does not have a key function, so the first constructor we emit should
 // cause the vtable to be defined (without assertions.)
-// CHECK: @_ZTVN6PR56971AE = weak_odr unnamed_addr constant
+// CHECK: @_ZTVN6PR56971AE = linkonce_odr unnamed_addr constant
 A::A() { }
 A::A(int) { }
 }

Modified: cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp Sun Jan 23 18:46:19 2011
@@ -103,12 +103,12 @@
 
 // C has no key function, so its vtable should have weak_odr linkage
 // and hidden visibility (rdar://problem/7523229).
-// CHECK-2: @_ZTV1C = weak_odr unnamed_addr constant
-// CHECK-2: @_ZTS1C = weak_odr constant
-// CHECK-2: @_ZTI1C = weak_odr unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTV1C = weak_odr hidden unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTS1C = weak_odr constant
-// CHECK-2-HIDDEN: @_ZTI1C = weak_odr hidden unnamed_addr constant
+// CHECK-2: @_ZTV1C = linkonce_odr unnamed_addr constant
+// CHECK-2: @_ZTS1C = linkonce_odr constant
+// CHECK-2: @_ZTI1C = linkonce_odr unnamed_addr constant
+// CHECK-2-HIDDEN: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-2-HIDDEN: @_ZTS1C = linkonce_odr constant
+// CHECK-2-HIDDEN: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
 
 // D has a key function that is defined in this translation unit so its vtable is
 // defined in the translation unit.
@@ -144,16 +144,16 @@
 
 // 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-7: @_ZTV1EIlE = weak_odr unnamed_addr constant
-// CHECK-7: @_ZTS1EIlE = weak_odr constant
-// CHECK-7: @_ZTI1EIlE = weak_odr unnamed_addr constant
+// linkonce_odr linkage.
+// CHECK-7: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
+// CHECK-7: @_ZTS1EIlE = linkonce_odr constant
+// CHECK-7: @_ZTI1EIlE = linkonce_odr unnamed_addr constant
 
 // F<long> is an implicit template instantiation with no key function,
-// so its vtable should have weak_odr linkage.
-// CHECK-8: @_ZTV1FIlE = weak_odr unnamed_addr constant
-// CHECK-8: @_ZTS1FIlE = weak_odr constant
-// CHECK-8: @_ZTI1FIlE = weak_odr unnamed_addr constant
+// so its vtable should have linkonce_odr linkage.
+// CHECK-8: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
+// CHECK-8: @_ZTS1FIlE = linkonce_odr constant
+// CHECK-8: @_ZTI1FIlE = linkonce_odr unnamed_addr constant
 
 // F<int> is an explicit template instantiation declaration without a
 // key function, so its vtable should have external linkage.
@@ -177,14 +177,14 @@
 // CHECK-12: @_ZTIN12_GLOBAL__N_11AE = internal unnamed_addr constant
 
 // F<char> is an explicit specialization without a key function, so
-// its vtable should have weak_odr linkage.
-// CHECK-13: @_ZTV1FIcE = weak_odr unnamed_addr constant
-// CHECK-13: @_ZTS1FIcE = weak_odr constant
-// CHECK-13: @_ZTI1FIcE = weak_odr unnamed_addr constant
+// its vtable should have linkonce_odr linkage.
+// CHECK-13: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
+// CHECK-13: @_ZTS1FIcE = linkonce_odr constant
+// CHECK-13: @_ZTI1FIcE = linkonce_odr unnamed_addr constant
 
 // RUN: FileCheck --check-prefix=CHECK-G %s < %t
 //
-// CHECK-G: @_ZTV1GIiE = weak_odr unnamed_addr constant
+// CHECK-G: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
 template <typename T>
 class G {
 public:
@@ -202,7 +202,7 @@
 
 // H<int> has a key function without a body but it's a template instantiation
 // so its VTable must be emmitted.
-// CHECK-H: @_ZTV1HIiE = weak_odr unnamed_addr constant
+// CHECK-H: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
 template <typename T>
 class H {
 public:

Modified: cfe/trunk/test/CodeGenCXX/vtt-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtt-layout.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtt-layout.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtt-layout.cpp Sun Jan 23 18:46:19 2011
@@ -59,6 +59,6 @@
 }
 
 // CHECK: @_ZTTN5Test11BE = unnamed_addr constant [1 x i8*] [i8* bitcast (i8** getelementptr inbounds ([4 x i8*]* @_ZTVN5Test11BE, i64 0, i64 3) to i8*)]
-// CHECK: @_ZTTN5Test41DE = weak_odr unnamed_addr constant [19 x i8*] [i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 12) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 18) 
 to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 17) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 20) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 
 10) to i8*)] 
-// CHECK: @_ZTTN5Test31DE = weak_odr unnamed_addr constant [13 x i8*] [i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 5) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitcast 
 (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 6) to i8*)] 
-// CHECK: @_ZTTN5Test21CE = weak_odr unnamed_addr constant [2 x i8*] [i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*)] 
+// CHECK: @_ZTTN5Test41DE = linkonce_odr unnamed_addr constant [19 x i8*] [i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 12) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 
 18) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 17) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 20) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, 
 i64 10) to i8*)] 
+// CHECK: @_ZTTN5Test31DE = linkonce_odr unnamed_addr constant [13 x i8*] [i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 5) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitc
 ast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 6) to i8*)] 
+// CHECK: @_ZTTN5Test21CE = linkonce_odr unnamed_addr constant [2 x i8*] [i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*)] 

Modified: cfe/trunk/test/CodeGenObjCXX/rtti.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/rtti.mm?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/rtti.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/rtti.mm Sun Jan 23 18:46:19 2011
@@ -4,19 +4,19 @@
 
 namespace std { class type_info; }
 
-// CHECK: @_ZTI1A = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS1A
+// CHECK: @_ZTI1A = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS1A
 @interface A
 @end
 
-// CHECK: @_ZTI1B = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv120__si_class_type_infoE{{.*}}@_ZTS1B{{.*}}@_ZTI1A
+// CHECK: @_ZTI1B = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv120__si_class_type_infoE{{.*}}@_ZTS1B{{.*}}@_ZTI1A
 @interface B : A
 @end
 
-// CHECK: @_ZTIP1B = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP1B{{.*}}), i32 0, {{.*}}@_ZTI1B
-// CHECK: @_ZTI11objc_object = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS11objc_object
-// CHECK: @_ZTIP11objc_object = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP11objc_object{{.*}}@_ZTI11objc_object
-// CHECK: @_ZTI10objc_class = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS10objc_class
-// CHECK: @_ZTIP10objc_class = weak_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP10objc_class{{.*}}@_ZTI10objc_class
+// CHECK: @_ZTIP1B = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP1B{{.*}}), i32 0, {{.*}}@_ZTI1B
+// CHECK: @_ZTI11objc_object = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS11objc_object
+// CHECK: @_ZTIP11objc_object = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP11objc_object{{.*}}@_ZTI11objc_object
+// CHECK: @_ZTI10objc_class = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS10objc_class
+// CHECK: @_ZTIP10objc_class = linkonce_odr unnamed_addr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP10objc_class{{.*}}@_ZTI10objc_class
 
 @protocol P;
 

Modified: cfe/trunk/test/SemaCXX/typeid-ref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typeid-ref.cpp?rev=124089&r1=124088&r2=124089&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typeid-ref.cpp (original)
+++ cfe/trunk/test/SemaCXX/typeid-ref.cpp Sun Jan 23 18:46:19 2011
@@ -6,7 +6,7 @@
 struct X { };
 
 void f() {
-  // CHECK: @_ZTS1X = weak_odr constant
-  // CHECK: @_ZTI1X = weak_odr unnamed_addr constant 
+  // CHECK: @_ZTS1X = linkonce_odr constant
+  // CHECK: @_ZTI1X = linkonce_odr unnamed_addr constant 
   (void)typeid(X&);
 }





More information about the cfe-commits mailing list