diff options
author | Richard Henderson <rth@cygnus.com> | 1999-09-04 19:41:35 -0700 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-09-05 02:41:35 +0000 |
commit | 87ff9c8e4bb514b8298fcd6431339197de456c0a (patch) | |
tree | e5cebe68f9343bcd10b7be75a8d15ab8791ec212 /gcc/except.c | |
parent | 6621f41de9e59ab84880d506f7de8b6ca6eccecb (diff) | |
download | gcc-87ff9c8e4bb514b8298fcd6431339197de456c0a.tar.gz |
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/gcc/except.c b/gcc/except.c index 6cc84659032..0a7b9a944df 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -408,6 +408,7 @@ Boston, MA 02111-1307, USA. */ #include "toplev.h" #include "intl.h" #include "obstack.h" +#include "ggc.h" /* One to use setjmp/longjmp method of generating code for exception handling. */ @@ -467,6 +468,10 @@ static void set_insn_eh_region PROTO((rtx *, int)); #ifdef DONT_USE_BUILTIN_SETJMP static void jumpif_rtx PROTO((rtx, rtx)); #endif +static void mark_eh_node PROTO((struct eh_node *)); +static void mark_eh_stack PROTO((struct eh_stack *)); +static void mark_eh_queue PROTO((struct eh_queue *)); +static void mark_tree_label_node PROTO ((struct label_node *)); rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx)); @@ -2333,7 +2338,76 @@ check_exception_handler_labels () } } - + +/* Mark the children of NODE for GC. */ + +static void +mark_eh_node (node) + struct eh_node *node; +{ + while (node) + { + if (node->entry) + { + ggc_mark_rtx (node->entry->outer_context); + ggc_mark_rtx (node->entry->exception_handler_label); + ggc_mark_tree (node->entry->finalization); + } + node = node ->chain; + } +} + +/* Mark S for GC. */ + +static void +mark_eh_stack (s) + struct eh_stack *s; +{ + if (s) + mark_eh_node (s->top); +} + +/* Mark Q for GC. */ + +static void +mark_eh_queue (q) + struct eh_queue *q; +{ + if (q) + mark_eh_node (q->head); +} + +/* Mark NODE for GC. A label_node contains a union containing either + a tree or an rtx. This label_node will contain a tree. */ + +static void +mark_tree_label_node (node) + struct label_node *node; +{ + while (node) + { + ggc_mark_tree (node->u.tlabel); + node = node->chain; + } +} + +/* Mark EH for GC. */ + +void +mark_eh_state (eh) + struct eh_status *eh; +{ + mark_eh_stack (&eh->x_ehstack); + mark_eh_queue (&eh->x_ehqueue); + ggc_mark_rtx (eh->x_catch_clauses); + + lang_mark_false_label_stack (eh->x_false_label_stack); + mark_tree_label_node (eh->x_caught_return_label_stack); + + ggc_mark_tree (eh->x_protect_list); + ggc_mark_rtx (eh->ehc); +} + /* This group of functions initializes the exception handling data structures at the start of the compilation, initializes the data structures at the start of a function, and saves and restores the |