[llvm] [dsymutil] Fix parallel linker's self-recursive typedef DIE by including referred-to types (PR #166767)

Roy Shi via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 05:04:54 PST 2025


https://github.com/royitaqi updated https://github.com/llvm/llvm-project/pull/166767

>From 448888c5aa1604133efd05facb3968d69c39184a Mon Sep 17 00:00:00 2001
From: Roy Shi <royshi at meta.com>
Date: Thu, 6 Nov 2025 04:37:33 -0800
Subject: [PATCH] [dsymutil] Fix parallel linker's self-recursive typedef DIE
 by adding ref type name

---
 llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp b/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
index 34174f98b7e37..ca918f6e17b38 100644
--- a/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
+++ b/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
@@ -377,8 +377,10 @@ Error SyntheticTypeNameBuilder::addTypeName(UnitEntryPairTy InputUnitEntryPair,
   } break;
   }
 
-  // If name for the DIE is not determined yet add referenced types to the name.
-  if (!HasLinkageName && !HasShortName && !HasDeclFileName) {
+  // If name for the DIE is not determined yet or if the DIE is a typedef, add
+  // referenced types to the name.
+  if ((!HasLinkageName && !HasShortName && !HasDeclFileName) ||
+      InputUnitEntryPair.DieEntry->getTag() == dwarf::DW_TAG_typedef) {
     if (InputUnitEntryPair.CU->find(InputUnitEntryPair.DieEntry,
                                     getODRAttributes()))
       if (Error Err = addReferencedODRDies(InputUnitEntryPair, AddParentNames,



More information about the llvm-commits mailing list