PING^2: [patch] pr/54508: fix incomplete debug information for class

Cary Coutant ccoutant@google.com
Thu Oct 4 17:38:00 GMT 2012


>       /* We also have to mark its parents as used.
> -        (But we don't want to mark our parents' kids due to this.)  */
> +        (But we don't want to mark our parent's kids due to this,
> +        unless it is a class.)  */
>       if (die->die_parent)
> -       prune_unused_types_mark (die->die_parent, 0);
> +       prune_unused_types_mark (die->die_parent,
> +                                (die->die_parent->die_tag == DW_TAG_class_type ||
> +                                 die->die_parent->die_tag == DW_TAG_structure_type ||
> +                                 die->die_parent->die_tag == DW_TAG_union_type));

I'd suggest replacing these conditions with a call to class_scope_p().
That will also cover DW_TAG_interface_type, which might be irrelevant
for this particular case, but is probably good to cover in the general
case.

-cary



More information about the Gcc-patches mailing list