diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-16 19:27:01 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-16 19:27:01 +0000 |
commit | 0046a2c25739a5e30a7440811937686c86c4984d (patch) | |
tree | a90b0ac22fb144d290710b57483c4c68cf242b07 /gcc/ggc.h | |
parent | 306d967ccec8dce3e47040f9a0ed1e9760e3a80f (diff) | |
download | gcc-0046a2c25739a5e30a7440811937686c86c4984d.tar.gz |
Thu Sep 16 11:50:52 1999 Alex Samuel <samuel@codesourcery.com>
* ggc.h (ggc_root): Move to ggc-common.c.
(roots): Remove.
(ggc_mark_rtx, ggc_mark_tree): Change to macro.
(ggc_mark_rtvec, ggc_mark_tree_varray): Declare extern.
(ggc_mark_tree_hash_table, ggc_mark_string, ggc_mark): Likewise.
(ggc_mark_roots, ggc_mark_rtx_children, ggc_mark_tree_children): New.
* ggc-common.c (ggc_root): Move from ggc.h.
(roots): Declare, static.
(ggc_mark_rtx, ggc_mark_tree): Renamed to...
(ggc_mark_rtx_children, ggc_mark_tree_children): Don't check for
null or check/set mark bit.
(ggc_mark_roots): New.
* ggc-simple.c (ggc_collect): Call ggc_mark_roots.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc.h')
-rw-r--r-- | gcc/ggc.h | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h index 20b3bb8771d..de43e9e8ab5 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -42,19 +42,6 @@ union tree_node; struct varasm_status; struct varray_head_tag; -/* Global roots that are preserved during calls to gc. */ - -struct ggc_root -{ - struct ggc_root *next; - void *base; - int nelt; - int size; - void (*cb) PROTO ((void *)); -}; - -extern struct ggc_root *roots; - /* Manipulate global roots that are needed between calls to gc. */ void ggc_add_root PROTO ((void *base, int nelt, int size, void (*)(void *))); void ggc_add_rtx_root PROTO ((struct rtx_def **, int nelt)); @@ -66,14 +53,29 @@ void ggc_del_root PROTO ((void *base)); /* Mark nodes from the gc_add_root callback. These functions follow pointers to mark other objects too. */ -void ggc_mark_rtx PROTO ((struct rtx_def *)); -void ggc_mark_rtvec PROTO ((struct rtvec_def *)); -void ggc_mark_tree PROTO ((union tree_node *)); -void ggc_mark_tree_varray PROTO ((struct varray_head_tag *)); -void ggc_mark_tree_hash_table PROTO ((struct hash_table *)); -void ggc_mark_string PROTO ((char *)); -void ggc_mark PROTO ((void *)); - +extern void ggc_mark_rtvec PROTO ((struct rtvec_def *)); +extern void ggc_mark_tree_varray PROTO ((struct varray_head_tag *)); +extern void ggc_mark_tree_hash_table PROTO ((struct hash_table *)); +extern void ggc_mark_string PROTO ((char *)); +extern void ggc_mark PROTO ((void *)); +extern void ggc_mark_roots PROTO((void)); + +extern void ggc_mark_rtx_children PROTO ((struct rtx_def *)); +extern void ggc_mark_tree_children PROTO ((union tree_node *)); + +#define ggc_mark_rtx(RTX_EXPR) \ + do { \ + rtx r__ = (RTX_EXPR); \ + if (r__ != NULL && ! ggc_set_mark_rtx (r__)) \ + ggc_mark_rtx_children (r__); \ + } while (0) + +#define ggc_mark_tree(TREE_EXPR) \ + do { \ + tree t__ = (TREE_EXPR); \ + if (t__ != NULL && ! ggc_set_mark_tree (t__)) \ + ggc_mark_tree_children (t__); \ + } while (0) /* A GC implementation must provide these functions. */ |