This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [debug-early] C++ clones and limbo DIEs
- From: Jason Merrill <jason at redhat dot com>
- To: Aldy Hernandez <aldyh 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: Thu, 05 Feb 2015 15:11:06 -0500
- 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> <54CEEBD5 dot 7090608 at redhat dot com> <54CEF9FE dot 6020107 at redhat dot com> <54D2B907 dot 1040309 at redhat dot com>
On 02/04/2015 07:27 PM, Aldy Hernandez wrote:
+ /* Anything who's context is not a TRANSLATION_UNIT_DECL will
+ be handled by either handling reachable functions below, or
+ by generating DIEs for types. */
"whose"
And what about namespace-scope variables? Maybe instead of checking for
TRANSLATION_UNIT_DECL context this should check non-function context.
+ /* This is the second iteration through the global symbols. Here we
+ pick up function statics that have been discovered by the call to
+ analyze_functions() above. */
+ FOR_EACH_SYMBOL (snode)
+ if (TREE_CODE (snode->decl) != FUNCTION_DECL
+ && DECL_CONTEXT (snode->decl)
+ /* Anything who's context is not a TRANSLATION_UNIT_DECL will
+ be handled by either handling reachable functions below, or
+ by generating DIEs for types. */
+ && TREE_CODE (DECL_CONTEXT (snode->decl)) == TRANSLATION_UNIT_DECL)
The comment says this catches "function statics", by which I assume you
mean static local variables, but then you check for TU context, so what
does this actually do?
+ // ?? Do we need this?
/* Emit debug info for namespace alias. */
if (!building_stmt_list_p ())
(*debug_hooks->early_global_decl) (alias);
Well, it isn't a symbol, so it won't be caught by
finalize_compilation_unit. So we either need to handle it here or in
emit_debug_for_namespace.
Jason