On Thu, Aug 22, 2024 at 5:04 PM Tom Tromey <tro...@adacore.com> wrote: > > >>>>> "Richard" == Richard Biener <richard.guent...@gmail.com> writes: > > >> While working on a patch to the Ada compiler, I found a spot in > >> dwarf2out.cc that calls add_name_attribute where a call to > >> add_name_and_src_coords_attributes would be better, because the latter > >> respects DECL_NAMELESS. > > Richard> If the point is DECL_NAMELESS shouldn't we omit the typedef DIE > Richard> instead? > > At least for Ada this doesn't really seem to change typedefs. Instead > it touches types like this: > > <1><26a>: Abbrev Number: 25 (DW_TAG_pointer_type) > <26b> DW_AT_byte_size : 8 > <26c> DW_AT_name : (indirect string, offset: 0x8f): > foo__TTdmSCFD__B12b__P11b > <270> DW_AT_type : <0x1e7> > <274> DW_AT_artificial : 1 > > Richard> A less controversial patch might be to use > Richard> dwarf2_name (name, 0) instead of IDENTIFIER_POINTER > > I can try that if you still think it's desirable; I just went with the > minimal change that made sense.
Well, in addition to honoring DECL_NAMELESS you'd get SRC coord attributes set - that ignores the possibility that not doing that was on purpose here? Honoring DECL_NAMELESS is obvious enough to me that I'd approve such a change - for the rest I'd have to dig more into the code to understand why it's using add_name_attribute in the first place ... Richard. > > Tom