Re: [debug-early] C++: emit early debug info for all globals, not just statics

2014-10-03 Thread Jason Merrill
On 10/02/2014 02:21 PM, Aldy Hernandez wrote: Actually, I think we/I need to rethink this whole globals thing. Currently we're early dumping global *_DECLs, and hoping dwarf2out recursion will also pick up types and any derivatives from the *_DECLs, but taking a closer look I've noticed a lot of

Re: [debug-early] C++: emit early debug info for all globals, not just statics

2014-10-02 Thread Jason Merrill
On 10/01/2014 05:31 PM, Aldy Hernandez wrote: + for (tree t = level-names; t; t = TREE_CHAIN(t)) +if (TREE_CODE (t) != TYPE_DECL +TREE_CODE (t) != PARM_DECL +!DECL_IS_BUILTIN (t)) + debug_hooks-early_global_decl (t); What does this do for templates? I think we don't

Re: [debug-early] C++: emit early debug info for all globals, not just statics

2014-10-02 Thread Aldy Hernandez
On 10/02/14 08:46, Jason Merrill wrote: On 10/01/2014 05:31 PM, Aldy Hernandez wrote: + for (tree t = level-names; t; t = TREE_CHAIN(t)) +if (TREE_CODE (t) != TYPE_DECL + TREE_CODE (t) != PARM_DECL + !DECL_IS_BUILTIN (t)) + debug_hooks-early_global_decl (t); What does this

Re: [debug-early] C++: emit early debug info for all globals, not just statics

2014-10-02 Thread Richard Biener
On October 2, 2014 8:21:51 PM CEST, Aldy Hernandez al...@redhat.com wrote: On 10/02/14 08:46, Jason Merrill wrote: On 10/01/2014 05:31 PM, Aldy Hernandez wrote: + for (tree t = level-names; t; t = TREE_CHAIN(t)) +if (TREE_CODE (t) != TYPE_DECL + TREE_CODE (t) != PARM_DECL +

Re: [debug-early] C++: emit early debug info for all globals, not just statics

2014-10-02 Thread Aldy Hernandez
On 10/02/14 12:56, Richard Biener wrote: Yes, but I don't see why we need the cleanup step. The decls are real after all. You won't hear me complain. I was just worried people were going to start complaining about larger .debug_info sections, since I see that the current code, as it stands

[debug-early] C++: emit early debug info for all globals, not just statics

2014-10-01 Thread Aldy Hernandez
While hunting another bug, I noticed that the namespace code dumping early debug information was only dumping statics. Ooops... The patch below fixes this oversight. Jason also suggested that we could look into emitting debug info for DECLs directly in rest_of_decl_compilation as we