[llvm] [cross-project-tests][DebugInfo] Make simplified-template-names test runnable on Darwin (PR #168725)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 19 09:24:25 PST 2025
dwblaikie wrote:
Ah, I see the preferred name thing in more detail https://godbolt.org/z/Tjhrx5x6n
```
DW_TAG_structure_type [4] * (0x0000000b)
DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000af] = "t1<t7<int> >")
...
DW_TAG_template_type_parameter [5] (0x0000007c)
DW_AT_type [DW_FORM_ref4] (cu + 0x0042 => {0x00000042} "t7i")
```
Yeah, so we should plumb through the preferred name into the type rendering (presumably it's already plumbed through as an option - the whole point is for it to be used in type printing in diagnostics, so we probably just have to set the right printing policy from `CGDebugInfo.cpp` based on whatever condition we use (looks like lldb debugger tuning) to decide whether to use the preferred type in the `DIType` of the `DITemplateTypeParameter`)
(aside: I think someone filed this bug recently, or I saw it going around, so you're probably already aware of it - but that preferred type `t7i` only gets used if it's emitted for some other reason into the DWARF - if you remove the `should_be_unnecessary` variable from the godbolt example above, the template's type parameter goes from `t7i` to `t7<int>` - I don't think that shouldn't happen, we should emit/use the typedef here even if it's the only use)
https://github.com/llvm/llvm-project/pull/168725
More information about the llvm-commits
mailing list