This is the mail archive of the
mailing list for the GCC project.
Re: [debug-early] C++ clones and limbo DIEs
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 01 Feb 2015 19:15:33 -0800
- Subject: Re: [debug-early] C++ clones and limbo DIEs
- Authentication-results: sourceware.org; auth=none
- References: <54B87E5B dot 1090502 at redhat dot com> <54B88149 dot 1040906 at redhat dot com> <54B94F4D dot 4040009 at redhat dot com> <54B97854 dot 7040007 at redhat dot com> <54C296B5 dot 4050506 at redhat dot com> <54C7FA41 dot 8010903 at redhat dot com> <54C92A59 dot 4070401 at redhat dot com> <54C92A80 dot 80306 at redhat dot com> <54C92FA8 dot 9040005 at redhat dot com> <54CBEB69 dot 3000401 at redhat dot com> <54CBFFE7 dot 1010003 at redhat dot com> <54CC1885 dot 5010105 at redhat dot com> <54CDC625 dot 8070902 at redhat dot com>
On 01/31/2015 10:22 PM, Jason Merrill wrote:
On 01/30/2015 06:49 PM, Aldy Hernandez wrote:
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+ if (DECL_ABSTRACT_ORIGIN (node->decl))
If we do this for all functions, not just those with
+ /* FIXME: What does this do for templates? I think we don't want to
+ send a template off to early_global_decl, but rather walk through
+ its specializations and emit them. */
for (tree t = level->names; t; t = TREE_CHAIN(t))
...could we drop this hunk?
Well, we'd also have to output globals, which we're currently not doing
in finalize_compilation_unit. But if you're ok with generating early
dwarf for functions as well as globals/statics from
finalize_compilation_unit() then we could get rid of virtually every
call to early_global_decl() from the front-ends.
So instead of FOR_EACH_*FUNCTION*, we could have:
+ symtab_node *node;
+ FOR_EACH_SYMBOL (node)
+ cgraph_node *cn = dyn_cast <cgraph_node *> (node);
+ /* Global symbols get early debug information regardless, but
+ functions need to be visible. */
+ if (!cn || cn->has_gimple_body_p ())
+ (*debug_hooks->early_global_decl) (node->decl);
Is this what you have in mind, or did you want to handle globals separately?
Do keep in mind that the above snippet would have the side-effect of not
creating debug information for optimized away global statics. I assume
this is intended or acceptable?