On Fri, Jan 16, 2015 at 4:11 AM, Jason Merrill <ja...@redhat.com> wrote:
> On 01/15/2015 09:58 PM, Aldy Hernandez wrote:
>>
>> The attached patch generates early DIEs for the C++
>> clones in the C++ parser.
>
>
> This strikes me as an unnecessary abstraction violation.

I'd hope that in the very distant future all early DIEs would be "created"
by the frontends (that is, dwarf2out.c wouldn't walk into parents/siblings
so much).

>> +  /* Emit debug information for clones.  */
>> +  symtab_node *node;
>> +  FOR_EACH_DEFINED_SYMBOL (node)
>> +    if (DECL_ABSTRACT_ORIGIN (node->decl))
>> +      debug_hooks->early_global_decl (DECL_ABSTRACT_ORIGIN (node->decl));
>
>
> And I note that you aren't even doing anything with the clone here, which
> suggests even more strongly that this is not what we want to do.

There must be a better place in the frontend to call early_global_decl
for those?  Maybe the point where we create the clone?

>> Now back to limbdo_die_list... My approach is to flush the limbo list,
>> generically, after the front-ends have finished, by adding a new
>> "early_finish" debug hook.  This gets rid of any permanence into LTO
>> time.  Then I flush it out again, if the middle end (or LTO, etc) has
>> added any limbo DIEs.
>
>
> Can you remove the first flush and just do it in the second place?

I hoped we wouldn't need the limbo list at all ... that is, parent DIEs
are always present when we create children.  I think that should
work in principle if the frontends would create DIEs while parsing.

Note that dwarf2out forces parent DIE creation in some cases
but not in some others - it would be interesting to sort out which
parent DIEs it thinks it cannot create when we create the DIE
for a sibling.  Maybe it's just poor ordering of early_global_decl
calls?

Richard.

> Jason
>

Reply via email to