aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-11-27 07:09:20 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-11-27 07:09:20 +0000
commit9ccb25d582aba15db6bb27944085c7478d532ade (patch)
tree0f3bff8650362598772997ba22bded572eefeb8e /gcc/tree.c
parentea8136058d7d1f3214da4ff8aaa16ea5de780b0e (diff)
downloadgcc-9ccb25d582aba15db6bb27944085c7478d532ade.zip
gcc-9ccb25d582aba15db6bb27944085c7478d532ade.tar.gz
gcc-9ccb25d582aba15db6bb27944085c7478d532ade.tar.bz2
tree.h (mark_tree_hashtable): New function.
* tree.h (mark_tree_hashtable): New function. * tree.c (mark_tree_hashtable_entry): New function. (mark_tree_hashtable): Likewise. * tree.c (struct list_hash): Remove. (list_hash_table): Make it be an htab. (struct list_proxy): New type. (list_hash_eq): New function. (list_hash_pieces): Renamed from ... (list_hash): ... this. (list_hash_lookup): Remove. (list_hash_add): Remove. (hash_tree_cons): Use the generic hashtable. (mark_list_hash): Remove. (init_tree): Create the hashtable. From-SVN: r37783
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index dcacdaf..acc7446 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -170,6 +170,7 @@ static unsigned int type_hash_hash PARAMS ((const void*));
static void print_type_hash_statistics PARAMS((void));
static int mark_hash_entry PARAMS((void **, void *));
static void finish_vector_type PARAMS((tree));
+static int mark_tree_hashtable_entry PARAMS((void **, void *));
/* If non-null, these are language-specific helper functions for
unsave_expr_now. If present, LANG_UNSAVE is called before its
@@ -3184,6 +3185,29 @@ mark_type_hash (arg)
htab_traverse (t, mark_hash_entry, 0);
}
+/* Mark the hashtable slot pointed to by ENTRY (which is really a
+ `tree**') for GC. */
+
+static int
+mark_tree_hashtable_entry (entry, data)
+ void **entry;
+ void *data ATTRIBUTE_UNUSED;
+{
+ ggc_mark_tree ((tree) *entry);
+ return 1;
+}
+
+/* Mark ARG (which is really a htab_t whose slots are trees) for
+ GC. */
+
+void
+mark_tree_hashtable (arg)
+ void *arg;
+{
+ htab_t t = *(htab_t *) arg;
+ htab_traverse (t, mark_tree_hashtable_entry, 0);
+}
+
static void
print_type_hash_statistics ()
{