]> granicus.if.org Git - clang/commitdiff
Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of...
authorAnders Carlsson <andersca@mac.com>
Mon, 24 Jan 2011 00:46:19 +0000 (00:46 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 24 Jan 2011 00:46:19 +0000 (00:46 +0000)
This fixes PR6996.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124089 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
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

index 9f3571ee63d511366f2e3a233c39c48fc0948f02..6e57f90e99ffd4e7b366fd842c83c5d2461843fc 100644 (file)
@@ -355,10 +355,10 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) {
         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 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty, bool Force) {
                           /*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);
index 631c335728659fb0ea605983552f4f98eb8d7403..ae61661da63a0365a0f23cbcc9d02c1ea688c17a 100644 (file)
@@ -210,7 +210,7 @@ void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
   // 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 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
       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 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
   case TSK_Undeclared:
   case TSK_ExplicitSpecialization:
   case TSK_ImplicitInstantiation:
+    return llvm::GlobalVariable::LinkOnceODRLinkage;
+
   case TSK_ExplicitInstantiationDefinition:
     return llvm::GlobalVariable::WeakODRLinkage;
     
@@ -1080,11 +1084,11 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
     // 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 {
index 39216658dcbdf624916edead91078214f5f83191..bbbc1b8a8bb6a0f2a723f4264cfb730fc08ff5c5 100644 (file)
@@ -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 {
index d8f10d453272896a379dd36204679a385a0c668c..8378bbd2340e7d6c2452ca3001f4027b0382b152 100644 (file)
@@ -43,9 +43,9 @@ void use_X1(X1 *x1) { x1->f(); }
 
 // 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
index 6ddb3fd2deab2fa3cf424b3c6c6ea411aae60510..45d1215d70134b606b5634b9db7c1dbb1711b325 100644 (file)
@@ -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(); };
   
index ebfcc51c49df9858942408b7ccaaab6915ddd98e..42fe435234042692124c1a3e88f901203df0c0e2 100644 (file)
@@ -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
 // 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 @@ namespace {
 };
 
 // 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();
 };
index b2e7bdaf3a00d57783d53ce7868a796c4e8ede8e..25736fd60309962bacfa1b41515b5cbace3736a9 100644 (file)
@@ -16,7 +16,7 @@ extern template class A<short>;
 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
index 0e6a2efbb37ef9ce73a544027deb1754a07697e5..931465060b6204b4f0382a7daa7819a21846e7cf 100644 (file)
@@ -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
index a9e4513b1647f520a88252966b35ca261d0e80d3..bf2e6798d2149feea04a1c020db0ddf6ea40bd68 100644 (file)
@@ -9,7 +9,7 @@ struct A {
 
 // 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) { }
 }
index 752f761ad77bd182d44f5ef486bf61160dfe978c..93ff165114f39af1d08b567b3f7653d827185722 100644 (file)
@@ -103,12 +103,12 @@ void use_F() {
 
 // 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 @@ void use_F() {
 
 // 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 @@ void use_F() {
 // 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 @@ void G_f0()  { new G<int>(); }
 
 // 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:
index 79238b1552e2a7957f3e03657fbdb4077064bdb8..ace7b74b2deebbe5370fac2b2c31f7b86c7dc0d1 100644 (file)
@@ -59,6 +59,6 @@ namespace Test4 {
 }
 
 // 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* 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 = 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*)] 
index f5264fe59db6f6a31d44cae038bc62d9086a6933..72de3ac980161a7f3335961bc6844c2aec266b9e 100644 (file)
@@ -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;
 
index e2d36983e563c89b0c8906e91b070c405db9b75a..d01fd316854c334ba18ac27e8a672558293aa4c5 100644 (file)
@@ -6,7 +6,7 @@ namespace std {
 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&);
 }