This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [debug-early] emitting early debug for external variables


On Wed, Mar 18, 2015 at 10:28 PM, Jason Merrill <jason@redhat.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).

Richard.

> Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]