[PATCH] D66352: Debug Info: Support for DW_AT_export_symbols for anonymous structs

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 15:47:30 PDT 2019


dblaikie added a comment.

In D66352#1636214 <https://reviews.llvm.org/D66352#1636214>, @aprantl wrote:

> In D66352#1636066 <https://reviews.llvm.org/D66352#1636066>, @dblaikie wrote:
>
> > I'm not sure I agree with the DWARF issue here - name handling is necessarily language-specific, and there's no ambiguity about what an anonymous struct means in C or C++, there's only one way to do name resolution correctly there, and that's by treating them as transparent.
> >
> > So I'd say rather than requiring all producers to put DW_AT_export_symbols on every anonymous struct in C or C++, consumers should assume its presence (if they want to model this name lookup this way - of course they don't need to model this in terms of DWARF concepts at all) for C and C++.
>
>
> While the link quoted is a DWARF issue, that issue did actually make it into DWARF 5, (cf. 5.7.1 line 28ff). In case you were already aware of this, are you suggesting we should ignore the DWARF spec in LLVM here?


Ah, thanks for pointing that out - I hadn't read.

Eh, I think it's still pretty unnecessary (& the DWARF spec is only suggestive, doesn't tend to have requirements in this regard) and so I'd probably suggest waiting until some consumer really wants this (& I'd still want to have a discussion with the consumer about why they find this to be needed). But it's really cheap (especially in DWARFv5 where it can use a const_value form & cost no bytes in debug_info (if/when that sort of thing is implemented in LLVM, if it isn't already).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66352/new/

https://reviews.llvm.org/D66352





More information about the llvm-commits mailing list