This is the mail archive of the 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

On 01/31/2015 10:22 PM, Jason Merrill wrote:
On 01/30/2015 06:49 PM, Aldy Hernandez wrote:
+    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))
     debug_hooks->early_global_decl (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;
+  {
+    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?


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