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

Michael Buch via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 02:28:48 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 &&
----------------
Michael137 wrote:

Nope no reason in particular. This is the way the code was prior to my changes, so wanted to keep the diff as small as possible

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


More information about the llvm-commits mailing list