aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2006-04-11 01:36:50 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2006-04-11 01:36:50 +0000
commit33c9159e09fb29cd6c47e076c6a2006a544884a9 (patch)
tree7d93c2f41a91db2797e82ea2593a73f5c5b9cda7 /gcc/function.c
parentab9260ac48d4f7dad156eae570df7ab4f826af7c (diff)
downloadgcc-33c9159e09fb29cd6c47e076c6a2006a544884a9.zip
gcc-33c9159e09fb29cd6c47e076c6a2006a544884a9.tar.gz
gcc-33c9159e09fb29cd6c47e076c6a2006a544884a9.tar.bz2
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
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c17
1 files changed, 17 insertions, 0 deletions
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 */