[llvm] [DWARFLinker] Preserve source order of member subprograms (PR #196443)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 16:05:55 PDT 2026
================
@@ -741,6 +750,12 @@ std::optional<size_t> OrderedChildrenIndexAssigner::tagToArrayIndex(
case dwarf::DW_TAG_namelist_item:
return 6;
case dwarf::DW_TAG_member:
+ case dwarf::DW_TAG_subprogram:
----------------
alx32 wrote:
Side question on the bucket sharing: width for bucket 7 is sized from the running count of all bucket 7 children in [`OrderedChildrenIndexAssigner`'s ctor](https://github.com/llvm/llvm-project/blob/af9775351003a538e584cb545f80fd6bedd51b04/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp#L695-L722), so once subprograms are counted in this bucket the hex width that `addOrderedName` pads to depends on the subprogram count too. For a class with `int a; int b;` plus N template instantiations, a CU that instantiates 1 of them lands at width 1 and keys `a` as `{F}S.{B}0a`, while a CU that instantiates 16 lands at width 2 and keys it as `{F}S.{B}00a`, so the same data member gets two `TypeEntry`s and two member DIEs under S. WDYT about giving subprograms their own bucket so member width stays decoupled from instantiation count?
https://github.com/llvm/llvm-project/pull/196443
More information about the llvm-commits
mailing list