This is the mail archive of the
mailing list for the GCC project.
Re: [debug-early] emitting early debug for external variables
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 19 Mar 2015 10:08:44 +0100
- Subject: Re: [debug-early] emitting early debug for external variables
- Authentication-results: sourceware.org; auth=none
- References: <5509E183 dot 6000908 at redhat dot com> <5509EDF1 dot 3040908 at redhat dot com>
On Wed, Mar 18, 2015 at 10:28 PM, Jason Merrill <email@example.com> wrote:
> If you move the call to rest_of_decl_compilation we could go through and
> prune the debug info for unused decls at dwarf2out_finish time, the way we
> do with unused types.
True. Note that the varpool nodes eventually get created once the
first use is seen.
So I wonder how much garbage we create by unconditionally creating the node
in rest_of_decl_compilation (yeah, header files, of course - probably
a similar issue
for unused function declarations?).
I'd prefer to do early_global_decl from rest_of_decl_compilation (and shun the
symtab/varpool walk - but that would require the FEs would hand off each global
that possibly needs debug info through rest_of_decl_compilation).
To prune globals during early(!) dwarf2out_finish you should be able to use the
symbol table (not sure if we prune all unused symbols, but surely the list
of references should be empty).