From 33c9159e09fb29cd6c47e076c6a2006a544884a9 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 11 Apr 2006 01:36:50 +0000 Subject: 20060410.c: New. PR/21391 * testsuite/gcc.dg/20060410.c: New. * 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 prune perennial dies. * function.c (used_types_insert): New. * function.h (struct function): Add used_types_hash field. (used_types_insert): Add prototype. * Makefile.in (FUNCTION_H): Depend on HASHTAB_H. * c-parser.c (c_parser_cast_expression): Save casted types in used types hash table. From-SVN: r112845 --- gcc/function.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index fd5eeb9..ecdf2823 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5587,6 +5587,23 @@ rest_of_handle_check_leaf_regs (void) return 0; } +/* Insert a type into the used types hash table. */ +void +used_types_insert (tree t, struct function *func) +{ + if (t != NULL && func != NULL) + { + void **slot; + + if (func->used_types_hash == NULL) + func->used_types_hash = htab_create_ggc (37, htab_hash_pointer, + htab_eq_pointer, NULL); + slot = htab_find_slot (func->used_types_hash, t, INSERT); + if (*slot == NULL) + *slot = t; + } +} + struct tree_opt_pass pass_leaf_regs = { NULL, /* name */ -- cgit v1.1