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