From bedda2da7f0434c931864fd1860d8b49106733bb Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 6 Apr 2000 00:51:25 +0000 Subject: final.c (final): Use xcalloc to allocate line_note_exists. * final.c (final): Use xcalloc to allocate line_note_exists. * function.c (free_after_compilation): Free the temp_slots. (assign_stack_temp_for_type): Use xmalloc to allocate temp_slots. (combine_temp_slot): Free temp_slots when they get combined. (purge_addressof): Fix typo in comment. * stmt.c (mark_goto_fixup): Mark the fixup itself. (expand_fixup): Allocate the fixup with ggc_alloc_obj. * ggc.h: Include varray.h. (ggc_pending_trees): Declare. (ggc_mark_tree_children): Remove declaration. (ggc_mark_tree): Just push unmarked trees on ggc_pending_trees. * ggc-common.c (ggc_pending_trees): New variable. (ggc_mark_roots): Call ggc_mark_trees. (ggc_mark_tree_children): Rename to ggc_mark_trees. Process all the ggc_pending_trees. * Makefile.in (GGC_H): New variable. Use it throughout in place of ggc.h. * Makefile.in (GGC_H): New variable. Use it throughout in place of ggc.h. * call.c: Don't include obstack.h. Include ggc.h. (obstack_chunk_alloc): Don't define. (obstack_chunk_free): Likewise. (add_candidate): Allocate the z_candidate with ggc_alloc_obj. * decl.c (push_switch): Use xmalloc to allocate the cp_switch. (pop_switch): Free it. * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs. * dump.c (dequeue_and_dump): Don't try to print the bit_position if we don't have a DECL_FIELD_OFFSET. * Makefile.in (GGC_H): Add varray.h. From-SVN: r32956 --- gcc/ggc.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'gcc/ggc.h') diff --git a/gcc/ggc.h b/gcc/ggc.h index 1ad8d1a..a79ffd5 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -19,6 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gansidecl.h" +#include "varray.h" /* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with an external gc library that might be linked in. */ @@ -40,11 +41,13 @@ struct rtvec_def; struct stmt_status; union tree_node; struct varasm_status; -struct varray_head_tag; /* Constants for general use. */ extern char *empty_string; +/* Trees that have been marked, but whose children still need marking. */ +extern varray_type ggc_pending_trees; + /* Manipulate global roots that are needed between calls to gc. */ void ggc_add_root PARAMS ((void *base, int nelt, int size, void (*)(void *))); void ggc_add_rtx_root PARAMS ((struct rtx_def **, int nelt)); @@ -64,7 +67,6 @@ extern void ggc_mark_roots PARAMS ((void)); extern void ggc_mark_rtx_children PARAMS ((struct rtx_def *)); extern void ggc_mark_rtvec_children PARAMS ((struct rtvec_def *)); -extern void ggc_mark_tree_children PARAMS ((union tree_node *)); /* If EXPR is not NULL and previously unmarked, mark it and evaluate to true. Otherwise evaluate to false. */ @@ -78,11 +80,11 @@ extern void ggc_mark_tree_children PARAMS ((union tree_node *)); ggc_mark_rtx_children (r__); \ } while (0) -#define ggc_mark_tree(EXPR) \ - do { \ - tree t__ = (EXPR); \ - if (ggc_test_and_set_mark (t__)) \ - ggc_mark_tree_children (t__); \ +#define ggc_mark_tree(EXPR) \ + do { \ + tree t__ = (EXPR); \ + if (ggc_test_and_set_mark (t__)) \ + VARRAY_PUSH_TREE (ggc_pending_trees, t__); \ } while (0) #define ggc_mark_rtvec(EXPR) \ -- cgit v1.1