pruning unused debugging types (enums/PR23336)
Aldy Hernandez
aldyh@redhat.com
Tue Apr 4 18:20:00 GMT 2006
On Fri, Mar 31, 2006 at 07:30:07AM -0800, Richard Henderson wrote:
> On Sat, Feb 18, 2006 at 07:23:30AM -0400, Aldy Hernandez wrote:
> > * function.h (struct function): Add used_types_hash field.
> > Include hashtab.h.
> > (used_types_insert): Protoize.
> > * function.c (used_types_insert): New.
> > * c-parser.c (c_parser_cast_expression): Call used_types_insert.
> > * dwarf2out.c (struct die_struct): Add die_perennial_p field.
> > (premark_used_types_helper): New.
> > (premark_used_types): New.
> > (gen_subprogram_die): Call premark_used_types.
> > (prune_unused_types_walk): Do not mark perennial types.
> > * Makefile.in (FUNCTION_H): Depend on HASHTAB_H.
>
> Ok.
While fixing a buglet from bitrot I realized that we can avoid saving the
casts into the used types hash table if we're not emitting debug information.
While I'm at it, would this change be acceptable?
+ /* Save casted types in the function's used types hash table. */
+ if (debug_info_level > DINFO_LEVEL_NONE)
+ used_types_insert (TREE_TYPE (groktypename (type_name)), cfun);
More information about the Gcc-patches
mailing list