static void ggc_mark_rtx_ptr PARAMS ((void *));
static void ggc_mark_tree_ptr PARAMS ((void *));
+static void ggc_mark_rtx_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_hash_table_ptr PARAMS ((void *));
static void ggc_mark_string_ptr PARAMS ((void *));
static struct ggc_root *roots;
-/* Type-correct function to pass to ggc_add_root. It just forwards
- *ELT (which is an rtx) to ggc_mark_tree_varray. */
-
-static void
-ggc_mark_rtx_ptr (elt)
- void *elt;
-{
- ggc_mark_rtx (*(rtx *) elt);
-}
-
-/* Type-correct function to pass to ggc_add_root. It just forwards
- *ELT (which is a tree) to ggc_mark_tree. */
-
-static void
-ggc_mark_tree_ptr (elt)
- void *elt;
-{
- ggc_mark_tree (*(tree *) elt);
-}
-
-/* Type-correct function to pass to ggc_add_root. It just forwards
- ELT (which is really a varray_type *) to ggc_mark_tree_varray. */
-
-static void
-ggc_mark_tree_varray_ptr (elt)
- void *elt;
-{
- ggc_mark_tree_varray (*(varray_type *) elt);
-}
-
-/* Type-correct function to pass to ggc_add_root. It just forwards
- ELT (which is really a struct hash_table **) to
- ggc_mark_tree_hash_table. */
-
-static void
-ggc_mark_tree_hash_table_ptr (elt)
- void *elt;
-{
- ggc_mark_tree_hash_table (*(struct hash_table **) elt);
-}
-
-/* Type-correct function to pass to ggc_add_root. It just forwards
- ELT (which is really a char **) to ggc_mark_string. */
-
-static void
-ggc_mark_string_ptr (elt)
- void *elt;
-{
- ggc_mark_string (*(char **) elt);
-}
-
/* Add BASE as a new garbage collection root. It is an array of
length NELT with each element SIZE bytes long. CB is a
function that will be called with a pointer to each element
ggc_add_root (base, nelt, sizeof(tree), ggc_mark_tree_ptr);
}
+/* Register a varray of rtxs as a GC root. */
+
+void
+ggc_add_rtx_varray_root (base, nelt)
+ varray_type *base;
+ int nelt;
+{
+ ggc_add_root (base, nelt, sizeof (varray_type),
+ ggc_mark_rtx_varray_ptr);
+}
+
/* Register a varray of trees as a GC root. */
void
}
}
+/* Mark all the elements of the varray V, which contains rtxs. */
+
+void
+ggc_mark_rtx_varray (v)
+ varray_type v;
+{
+ int i;
+
+ if (v)
+ for (i = v->num_elements - 1; i >= 0; --i)
+ ggc_mark_rtx (VARRAY_RTX (v, i));
+}
+
/* Mark all the elements of the varray V, which contains trees. */
void
hash_traverse (ht, ggc_mark_tree_hash_table_entry, /*info=*/0);
}
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ *ELT (which is an rtx) to ggc_mark_rtx. */
+
+static void
+ggc_mark_rtx_ptr (elt)
+ void *elt;
+{
+ ggc_mark_rtx (*(rtx *) elt);
+}
+
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ *ELT (which is a tree) to ggc_mark_tree. */
+
+static void
+ggc_mark_tree_ptr (elt)
+ void *elt;
+{
+ ggc_mark_tree (*(tree *) elt);
+}
+
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ ELT (which is really a varray_type *) to ggc_mark_rtx_varray. */
+
+static void
+ggc_mark_rtx_varray_ptr (elt)
+ void *elt;
+{
+ ggc_mark_rtx_varray (*(varray_type *) elt);
+}
+
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ ELT (which is really a varray_type *) to ggc_mark_tree_varray. */
+
+static void
+ggc_mark_tree_varray_ptr (elt)
+ void *elt;
+{
+ ggc_mark_tree_varray (*(varray_type *) elt);
+}
+
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ ELT (which is really a struct hash_table **) to
+ ggc_mark_tree_hash_table. */
+
+static void
+ggc_mark_tree_hash_table_ptr (elt)
+ void *elt;
+{
+ ggc_mark_tree_hash_table (*(struct hash_table **) elt);
+}
+
+/* Type-correct function to pass to ggc_add_root. It just forwards
+ ELT (which is really a char **) to ggc_mark_string. */
+
+static void
+ggc_mark_string_ptr (elt)
+ void *elt;
+{
+ ggc_mark_string (*(char **) elt);
+}
+
/* Allocate a gc-able string. If CONTENTS is null, then the memory will
be uninitialized. If LENGTH is -1, then CONTENTS is assumed to be a
null-terminated string and the memory sized accordingly. Otherwise,
void ggc_add_rtx_root PARAMS ((struct rtx_def **, int nelt));
void ggc_add_tree_root PARAMS ((union tree_node **, int nelt));
void ggc_add_string_root PARAMS ((char **, int nelt));
+void ggc_add_rtx_varray_root PARAMS ((struct varray_head_tag **, int nelt));
void ggc_add_tree_varray_root PARAMS ((struct varray_head_tag **, int nelt));
void ggc_add_tree_hash_table_root PARAMS ((struct hash_table **, int nelt));
void ggc_del_root PARAMS ((void *base));
/* Mark nodes from the gc_add_root callback. These functions follow
pointers to mark other objects too. */
+extern void ggc_mark_rtx_varray PARAMS ((struct varray_head_tag *));
extern void ggc_mark_tree_varray PARAMS ((struct varray_head_tag *));
extern void ggc_mark_tree_hash_table PARAMS ((struct hash_table *));
extern void ggc_mark_roots PARAMS ((void));