[llvm] [llvm][DebugInfo] Drop \01 mangling prefix when inserting linkage name into accelerator table (PR #138852)

Jacob Lalonde via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 10:47:47 PDT 2025


================
@@ -489,12 +489,17 @@ void DwarfDebug::addSubprogramNames(
   if (SP->getName() != "")
     addAccelName(Unit, NameTableKind, SP->getName(), Die);
 
+  // We drop the mangling escape prefix when emitting the DW_AT_linkage_name. So
+  // ensure we don't include it when inserting into the accelerator tables.
+  llvm::StringRef LinkageName =
+      GlobalValue::dropLLVMManglingEscape(SP->getLinkageName());
+
   // If the linkage name is different than the name, go ahead and output that as
   // well into the name table. Only do that if we are going to actually emit
   // that name.
-  if (SP->getLinkageName() != "" && SP->getName() != SP->getLinkageName() &&
+  if (LinkageName != "" && SP->getName() != LinkageName &&
----------------
Jlalond wrote:

@Michael137 mostly asking for myself, but is there a reason we check for `""` instead of empty?

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


More information about the llvm-commits mailing list