This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR59319] output friends in debug info
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Cc: ccoutant at gmail dot com
- Date: Fri, 23 Sep 2016 21:21:47 -0300
- Subject: Re: [PR59319] output friends in debug info
- Authentication-results: sourceware.org; auth=none
- References: <or8tvsa95w.fsf@livre.home> <CADzB+2mGcihR82ikSo3OhgcEfRwyhTx8MK98xirQ7FyhuoLnxw@mail.gmail.com> <ord1kpg8ay.fsf@livre.home>
On Aug 30, 2016, Alexandre Oliva <aoliva@redhat.com> wrote:
> Handling non-template friends is kind of easy, but it required a bit
> of infrastructure in dwarf2out to avoid (i) forcing debug info for
> unused types or functions: DW_TAG_friend DIEs are only emitted if
> their DW_AT_friend DIE is emitted, and (ii) creating DIEs for such
> types or functions just to have them discarded at the end. To this
> end, I introduced a list (vec, actually) of types with friends,
> processed at the end of the translation unit, and a list of
> DW_TAG_friend DIEs that, when we're pruning unused types, reference
> DIEs that are still not known to be used, revisited after we finish
> deciding all other DIEs, so that we prune DIEs that would have
> referenced pruned types or functions.
> Handling template friends turned out to be trickier: there's no
> representation in DWARF for templates. I decided to give debuggers as
> much information as possible, enumerating all specializations of
> friend templates and outputting DW_TAG_friend DIEs referencing them as
> well. I considered marking those as DW_AT_artificial, to indicate
> they're not explicitly stated in the source code, but in the end we
> decided that was not useful. The greatest challenge was to enumerate
> all specializations of a template. It looked trivial at first, given
> DECL_TEMPLATE_INSTANTIATIONS, but it won't list specializations of
> class-scoped functions and of nested templates. For other templates,
> I ended up writing code to look for specializations in the hashtables
> of decl or type specializations. That's not exactly efficient, but it
> gets the job done.
Regstrapped on x86_64-linux-gnu and i686-linux-gnu, I'd failed to
mention.
Ping?
https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02092.html
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer