[libcxx-commits] [clang] [libcxx] [CodeGen] Added '*' to internal linkage types (PR #220864)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 20 01:48:05 PDT 2026


================
@@ -3606,22 +3606,33 @@ llvm::GlobalVariable *ItaniumRTTIBuilder::GetAddrOfTypeName(
   llvm::raw_svector_ostream Out(Name);
   CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, Out);
 
-  // We know that the mangled name of the type starts at index 4 of the
-  // mangled name of the typename, so we can just index into it in order to
-  // get the mangled name of the type.
+  // RTTI type-name symbol has form "_ZTS<mangled-string>". The string stored in
+  // type_info object excludes the "_ZTS" prefix. So we skip past the first 4
+  // characters. For types that do not have externally visible Clang/C++
+  // linkage, '*' is prepended to the type-name string so that within libstdc++
+  // RTTI names compare correctly via strcmp across translation units. LLVM
+  // internal linkage marks incomplete types as internal linkage, resulting in
----------------
matthew-j-code wrote:

Updated the comment accordingly

https://github.com/llvm/llvm-project/pull/220864


More information about the libcxx-commits mailing list