summaryrefslogtreecommitdiff
path: root/gcc/except.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@cygnus.com>1999-08-10 16:19:16 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>1999-08-10 16:19:16 +0000
commit1ef1bf063b0a944563d37d7d079d9f860d149c0b (patch)
tree2b4a46a35a3de3f7ea944875d45ee6b88e31d370 /gcc/except.h
parenta8688bd6e92665a50b78fb7b5331c879f1f99801 (diff)
downloadgcc-1ef1bf063b0a944563d37d7d079d9f860d149c0b.tar.gz
except.h (eh_nesting_info): Add new structure defintion.
Tue Aug 10 10:47:42 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * except.h (eh_nesting_info): Add new structure defintion. (init_eh_nesting_info, free_eh_nesting_info): Add function prototypes. (reachable_handlers, update_rethrow_references): Add function prototypes. * rtl.h (struct rtvec_def): Update comments. REG_EH_RETHROW takes a rethrow symbol instead of an integer exception region number. * flow.c (Make_edges): Use new exception nesting routines to determine which handlers are reachable from a CALL or asynchronous insn. Dont add an edge for calls with a REG_EH_REGION of -1 to non-local goto receivers. (delete_eh_regions): Update rethrow labels, and don't delete regions which are the target of a rethrow. * except.c (struct func_eh_entry): Add rethrow_ref field, now we can avoid overloading the SYMBOL_REF_USED flag. (rethrow_symbol_map): Use new rethrow_ref field. (rethrow_used): Use new rethrow_ref field. (expand_rethrow): REG_EH_RETHROW now has a SYMBOL_REF instead of an integer. Fix formatting. (output_exception_table_entry): Use new rethrow_ref field. (can_throw): Check for EH_REGION_NOTE before deciding whether a CALL can throw or not. (scan_region): Call rethrow_used() instead of accessing data structure. (update_rethrow_references): New function to make sure only regions which are still targets of a rethrow are flagged as such. (process_nestinfo): New static function to initialize a handler list for a specific region. (init_eh_nesting_info): New function to allocate and initialize the list of all EH handlers reachable from all regions. (reachable_handlers): New function to retrieve the list of handlers reachable from a specific region and insn. (free_eh_nesting_info): New function to dispose of a list of reachable handlers. From-SVN: r28647
Diffstat (limited to 'gcc/except.h')
-rw-r--r--gcc/except.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/except.h b/gcc/except.h
index 2e3e794f7f3..73bbe4dc8d7 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -266,6 +266,11 @@ rtx rethrow_symbol_map PROTO((rtx, rtx (*)(rtx)));
int rethrow_used PROTO((int));
+/* Update the rethrow references to reflect rethrows which have been
+ optimized away. */
+
+void update_rethrow_references PROTO((void));
+
/* Return the region number a this is the rethrow label for. */
int eh_region_from_symbol PROTO((rtx));
@@ -278,6 +283,46 @@ struct handler_info *get_first_handler PROTO((int));
int find_all_handler_type_matches PROTO((void ***));
+/* The eh_nesting_info structure is used to find a list of valid handlers
+ for any arbitrary exception region. When init_eh_nesting_info is called,
+ the information is all pre-calculated and entered in this structure.
+ REGION_INDEX is a vector over all possible region numbers. Since the
+ number of regions is typically much smaller than the range of block
+ numbers, this is a sparse vector and the other data structures are
+ represented as dense vectors. Indexed with an exception region number, this
+ returns the index to use in the other data structures to retreive the
+ correct information.
+ HANDLERS is an array of vectors which point to handler_info structures.
+ when indexed, it gives the list of all possible handlers which can
+ be reached by a throw from this exception region.
+ NUM_HANDLERS is the equivilent array indicating how many handler
+ pointers there are in the HANDLERS vector.
+ OUTER_INDEX indicates which index represents the information for the
+ outer block. 0 indicates there is no outer context.
+ REGION_COUNT is the number of regions. */
+
+typedef struct eh_nesting
+{
+ int *region_index;
+ handler_info ***handlers;
+ int *num_handlers;
+ int *outer_index;
+ int region_count;
+} eh_nesting_info;
+
+/* Initialize the eh_nesting_info structure. */
+
+eh_nesting_info *init_eh_nesting_info PROTO((void));
+
+/* Get a list of handlers reachable from a an exception region/insn. */
+
+int reachable_handlers PROTO((int, eh_nesting_info *, rtx,
+ handler_info ***handlers));
+
+/* Free the eh_nesting_info structure. */
+
+void free_eh_nesting_info PROTO((eh_nesting_info *));
+
extern void init_eh PROTO((void));
/* Initialization for the per-function EH data. */