This is the mail archive of the gcc-patches@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] C++ clones and limbo DIEs



And what about namespace-scope variables?  Maybe instead of checking for
TRANSLATION_UNIT_DECL context this should check non-function context.

Done.


+  /* 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?

Absolutely nothing, basically because #if 0 would have been too obvious. It was actually there to test if you were on your game. You passed :).

Static locals were actually being handled by the recursion through dwarf2out_decl when generating DIEs for functions. And changing the context for symbols above to non-function context as you suggest, handled class member functions containing statics.

+  // ?? 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.

Fair enough.

The attached patch still passes the guality tests with no regressions. My apologies for the lack of ChangeLog entries. I've given up on them, especially on multiple iterations. And it seems I'll have to rewrite them at merge time anyhow.

How does this look?

Aldy

Attachment: curr
Description: Text document


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