[debug-early] C++ clones and limbo DIEs
Jason Merrill
jason@redhat.com
Thu Feb 5 20:11:00 GMT 2015
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
More information about the Gcc-patches
mailing list