This is the mail archive of the
mailing list for the GCC project.
Re: [debug-early] reuse variable DIEs and fix their context
- From: Jason Merrill <jason at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Aug 2014 14:01:05 -0400
- Subject: Re: [debug-early] reuse variable DIEs and fix their context
- Authentication-results: sourceware.org; auth=none
- References: <53FD45A7 dot 4000804 at redhat dot com> <CAFiYyc0rftZkObJxo13UCwLvkhqMPNXkE11g-8tvdefQmhN2BQ at mail dot gmail dot com> <53FF6840 dot 9030505 at redhat dot com>
On 08/28/2014 01:34 PM, Aldy Hernandez wrote:
I wonder if instead of early dumping of all the DECLs, we could only
dump the toplevel scoped DECLs, and let inheritance set the proper
Yes, I think this makes a lot more sense; do it at a well-defined point
in compilation rather than as part of free_lang_data.
We could start with calling dwarf2out_early_decl() for each function
decl, and then for every global. This is analogous to what we currently
do for late dwarf2out.
see final.c for the functions:
if (!DECL_IGNORED_P (current_function_decl))
see c/c-decl.c for the globals:
FOR_EACH_VEC_ELT (*all_translation_units, i, t)
c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t)));
c_write_global_declarations_2 (BLOCK_VARS (ext_block));
The problem being that to calculate `ext_block' above, we need intimate
knowledge of scopes and such, only available in the FE. Is there a
generic way of determining if a DECL is in global scope?
Why not do it in the FE, i.e. *_write_global_declarations?