diff options
author | crux <crux@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-07-31 12:46:53 +0000 |
---|---|---|
committer | crux <crux@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-07-31 12:46:53 +0000 |
commit | 304c5bf10d4e1133798c98a934621fee5f73d5e9 (patch) | |
tree | 286c1d2fa0096b032809b04fe3925b118bc31fd7 /gcc/except.h | |
parent | 3a51bad938848fc9a96d13800b3e9a9af6ccf923 (diff) | |
download | gcc-304c5bf10d4e1133798c98a934621fee5f73d5e9.tar.gz |
Backport of GC branch patches part 1: kill eh status saving.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28357 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.h')
-rw-r--r-- | gcc/except.h | 80 |
1 files changed, 62 insertions, 18 deletions
diff --git a/gcc/except.h b/gcc/except.h index a8c4f9c8004..2e3e794f7f3 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -24,10 +24,6 @@ typedef struct rtx_def *_except_rtx; #define rtx _except_rtx #endif -/* The label generated by expand_builtin_eh_return. */ - -extern rtx eh_return_stub_label; - #ifdef TREE_CODE /* A stack of labels. CHAIN points to the next entry in the stack. */ @@ -67,6 +63,10 @@ struct eh_entry { rtx false_label; rtx rethrow_label; }; +#else +struct label_node; +struct eh_entry; +#endif /* A list of EH_ENTRYs. ENTRY is the entry; CHAIN points to the next entry in the list, or is NULL if this is the last entry. */ @@ -92,6 +92,64 @@ struct eh_queue { struct eh_node *tail; }; +/* Used to save exception handling status for each function. */ +struct eh_status +{ + /* A stack used for keeping track of the currently active exception + handling region. As each exception region is started, an entry + describing the region is pushed onto this stack. The current + region can be found by looking at the top of the stack, and as we + exit regions, the corresponding entries are popped. + + Entries cannot overlap; they can be nested. So there is only one + entry at most that corresponds to the current instruction, and that + is the entry on the top of the stack. */ + struct eh_stack x_ehstack; + /* This stack is used to represent what the current eh region is + for the catch blocks beings processed */ + struct eh_stack x_catchstack; + /* A queue used for tracking which exception regions have closed but + whose handlers have not yet been expanded. Regions are emitted in + groups in an attempt to improve paging performance. + + As we exit a region, we enqueue a new entry. The entries are then + dequeued during expand_leftover_cleanups and expand_start_all_catch, + + We should redo things so that we either take RTL for the handler, + or we expand the handler expressed as a tree immediately at region + end time. */ + struct eh_queue x_ehqueue; + /* Insns for all of the exception handlers for the current function. + They are currently emitted by the frontend code. */ + rtx x_catch_clauses; + /* A random data area for the front end's own use. */ + struct label_node *x_false_label_stack; + /* Keeps track of the label to resume to should one want to resume + normal control flow out of a handler (instead of, say, returning to + the caller of the current function or exiting the program). */ + struct label_node *x_caught_return_label_stack; + /* A TREE_CHAINed list of handlers for regions that are not yet + closed. The TREE_VALUE of each entry contains the handler for the + corresponding entry on the ehstack. */ + union tree_node *x_protect_list; + /* The EH context. Nonzero if the function has already + fetched a pointer to the EH context for exception handling. */ + rtx ehc; + /* The label generated by expand_builtin_eh_return. */ + rtx x_eh_return_stub_label; +}; + +#define ehstack (current_function->eh->x_ehstack) +#define catchstack (current_function->eh->x_catchstack) +#define ehqueue (current_function->eh->x_ehqueue) +#define catch_clauses (current_function->eh->x_catch_clauses) +#define false_label_stack (current_function->eh->x_false_label_stack) +#define caught_return_label_stack (current_function->eh->x_caught_return_label_stack) +#define protect_list (current_function->eh->x_protect_list) +#define current_function_ehc (current_function->eh->ehc) +#define eh_return_stub_label (current_function->eh->x_eh_return_stub_label) + +#ifdef TREE_CODE /* Start an exception handling region. All instructions emitted after this point are considered to be part of the region until expand_eh_region_end () is invoked. */ @@ -145,11 +203,6 @@ extern rtx pop_label_entry PROTO((struct label_node **labelstack)); extern tree top_label_entry PROTO((struct label_node **labelstack)); -/* A set of insns for the catch clauses in the current function. They - will be emitted at the end of the current function. */ - -extern rtx catch_clauses; - #endif /* Test: is exception handling turned on? */ @@ -318,20 +371,11 @@ extern int is_exception_handler_label PROTO((int)); extern void check_exception_handler_labels PROTO((void)); -/* A stack used to keep track of the label used to resume normal program - flow out of the current exception handler region. */ - -extern struct label_node *caught_return_label_stack; - /* Keeps track of the label used as the context of a throw to rethrow an exception to the outer exception region. */ extern struct label_node *outer_context_label_stack; -/* A random area used for purposes elsewhere. */ - -extern struct label_node *false_label_stack; - /* A list of labels used for exception handlers. It is created by find_exception_handler_labels for the optimization passes. */ |