From 627e17872263df1abe20244ca5a4199ae51970ad Mon Sep 17 00:00:00 2001 From: Florian Liekweg Date: Fri, 26 Apr 2002 14:19:23 +0000 Subject: [PATCH] Changed exception markings types --flo [r387] --- ir/st/Makefile.in | 2 +- ir/st/exc.c | 47 +++++------------------------------------------ ir/st/exc.h | 8 +++++--- 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/ir/st/Makefile.in b/ir/st/Makefile.in index 4f1d12c4e..49d5a9fd2 100644 --- a/ir/st/Makefile.in +++ b/ir/st/Makefile.in @@ -22,7 +22,7 @@ include $(topdir)/MakeRules CPPFLAGS += -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/tr \ -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/adt \ -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/tv \ - -I$(top_srcdir)/ir/ana + -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/debug include $(top_srcdir)/MakeTargets diff --git a/ir/st/exc.c b/ir/st/exc.c index 8a00173f1..5ef2b18c6 100644 --- a/ir/st/exc.c +++ b/ir/st/exc.c @@ -19,10 +19,11 @@ # include "exc.h" static char* exc_strings [] = { - "Invalid", - "Normal", - "Region Entry", - "Handler Entry", + "Invalid", /* invalid */ + "Normal", /* normal */ + "Entry", /* entry to region */ + "Exit", /* exit of region */ + "Handler", /* entry to handler */ "Cont" }; @@ -195,44 +196,6 @@ bool is_handler_block (ir_graph *graph, ir_node *block) return (exc_handler == get_Block_exc (block)); } -/* - Return true iff a new exception region must be left upon exit of the - non-exception blocks among the CFG predecessors of this block. - - If this block has CFG predecessors that are partly handler blocks and - partly normal blocks, then we must return true. -*/ -bool is_cont_entry (ir_graph *graph, ir_node *block) -{ - assert (0 && "Not implemented"); - - if (exc_invalid == get_Block_exc (block)) - { - bool has_exc = false; /* wether we have exception cfg predecessors */ - bool has_cfg = false; /* wether we have normal cfg predecessors */ - - int i = 0; - int n = get_irn_arity (block); - - ir_node *pred = 0; - - for (i = 0; (i < n) && (!has_exc && !has_cfg); i ++) - { - pred = get_irn_n (block, i); - - if (is_exc_jmp (pred)) - has_exc = true; - else if (is_cfg_jmp (pred)) - has_cfg = true; - } - - if (has_cfg && has_exc) - set_Block_exc (block, exc_cont); - } - - return (exc_cont == get_Block_exc (block)); -} - /* Convert a value of type exc_t to a descriptive string. Returns a reference to a statically allocated, constant string. diff --git a/ir/st/exc.h b/ir/st/exc.h index 27d3ed80b..fa7b496cd 100644 --- a/ir/st/exc.h +++ b/ir/st/exc.h @@ -16,11 +16,11 @@ $Id$ ***/ +# include "irnode.h" + # ifndef _EXC_H_ # define _EXC_H_ -# include "irnode.h" - # include "st.h" # include "irop.h" # include "irouts.h" @@ -34,9 +34,11 @@ typedef enum { // must push a new exc contrext at entry of block: exc_region, /* region entry */ + // must pop current exc contrext at exit of block + exc_exit, /* region exit */ + // must pop current exc contrext at entry of block exc_handler, /* handler entry */ - exc_cont, /* cont block */ exc_max /* maximum value of enum for 'bounds checking' */ } exc_t; -- 2.20.1