[PATCH] D46665: [Itanium] Emit type info names with external linkage.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 9 20:35:55 PDT 2018


rjmccall added inline comments.


================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:3098
+    InfoLinkage = getTypeInfoLinkage(CGM, Ty);
+    NameLinkage = getTypeInfoLinkage(CGM, Ty, /*ForName*/ true);
+  }
----------------
I think we could probably just have the function return both instead of requiring the callee to make two calls.


================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:3110
   ItaniumCXXABI::RTTIUniquenessKind RTTIUniqueness =
-      CXXABI.classifyRTTIUniqueness(Ty, Linkage);
+      CXXABI.classifyRTTIUniqueness(Ty, InfoLinkage);
   if (RTTIUniqueness != ItaniumCXXABI::RUK_Unique) {
----------------
This should be the name linkage, I think.  The targets using non-unique RTTI names (i.e. Darwin ARM64) would want this bit to be set for the types they use non-unique RTTI names for, i.e. for external types with default visibility, even if the type is incomplete in the current translation unit and thus the type_info object has been demoted to internal linkage.  (A complete type with internal linkage should not have the bit set.)


https://reviews.llvm.org/D46665





More information about the cfe-commits mailing list