[PATCH] D47092: downgrade strong type info names to weak_odr linkage

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 18 16:13:27 PDT 2018


rjmccall added a comment.

Incomplete classes are a curse.  I don't suppose we can just modify the language specification to make it illegal to use `typeid(Incomplete*)`?  Or make equality/hashing undefined in these cases?



================
Comment at: test/CodeGenCXX/arm64.cpp:48
   void A::foo() {}
-  // CHECK-GLOBALS-DAG: @_ZTSN5test21AE = constant [11 x i8]
+  // CHECK-GLOBALS-DAG: @_ZTSN5test21AE = weak_odr constant [11 x i8]
   // CHECK-GLOBALS-DAG: @_ZTIN5test21AE = constant { {{.*}}, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @_ZTSN5test21AE, i32 0, i32 0) }
----------------
The way the Darwin ARM64 ABI handles non-unique RTTI is by setting a flag indicating that clients should do string comparisons/hashes; it does not rely on the type name symbols being uniqued.  So this should stay external and the _ZTI definition should change to set the bit.


================
Comment at: test/CodeGenCXX/windows-itanium-type-info.cpp:31
 // CHECK-DAG: @_ZTI7derived = dso_local dllexport constant
-// CHECK-DAG: @_ZTS7derived = dso_local dllexport constant
+// CHECK-DAG: @_ZTS7derived = weak_odr dso_local dllexport constant
 // CHECK-DAG: @_ZTV7derived = dso_local dllexport unnamed_addr constant
----------------
Is this actually okay?  I didn't think dllexport supported weak symbols.


Repository:
  rC Clang

https://reviews.llvm.org/D47092





More information about the cfe-commits mailing list