This patch adds a new field to DIComposite metadata that
holds the type of the preferred name for a structure.
This will be used to encode the [[clang::preferred_name]]
attribute into DWARF.
Michael137 on Mar 1 2023, 8:53 AM.Authored by
Looks pretty good, some nitpicks inside.
(FWIW, reckon this is simple/easy enough to add to DWARF/worth filing DWARF standard issue for - at least once the current DWARF committee turmoil settles out.
Not sure if there's been any discussion with the GNU side of the world about them implementing/adopting/using a source attribute like this.
But, equally, pretty cheap to give this a while & see how it plays out/if it's as valuable/convenient as we hope it is before standardizing. No great cost to getting more implementation experience)
We were considering this. It does fit the use-case nicely by the sound of it. But for LLDB it was much more convenient for the preferred name to be encoded as a reference to the DIE, not a raw string (I haven't actually tried implementing it purely based on the name of the type. We'd have to do a lookup into the accelerator tables by name at the very least I guess)