From cd51c273d337e69ee1a8f120e74cc0d8c785fb93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Fri, 29 Apr 2005 12:18:36 +0000 Subject: [PATCH] more state handling [r5746] --- ir/ir/irgraph.c | 1 + ir/ir/irgraph_t.h | 5 ++++- ir/ir/iropt.c | 2 +- ir/ir/irprog.c | 1 + ir/ir/irprog_t.h | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index f372e5046..6b4b14405 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -174,6 +174,7 @@ new_r_ir_graph (entity *ent, int n_loc) res->typeinfo_state = ir_typeinfo_none; set_irp_typeinfo_inconsistent(); /* there is a new graph with typeinfo_none. */ res->loopinfo_state = loopinfo_none; + res->class_cast_state = ir_class_casts_transitive; /*-- Type information for the procedure of the graph --*/ res->ent = ent; diff --git a/ir/ir/irgraph_t.h b/ir/ir/irgraph_t.h index 622d89f50..ffff2ff5e 100644 --- a/ir/ir/irgraph_t.h +++ b/ir/ir/irgraph_t.h @@ -29,6 +29,7 @@ #include "irprog.h" #include "pseudo_irg.h" #include "type_t.h" +#include "tr_inheritance.h" #include "irloop.h" #include "execution_frequency.h" @@ -90,6 +91,7 @@ struct ir_graph { irg_inline_property inline_property; /**< How to handle inlineing. */ irg_loopinfo_state loopinfo_state; /**< state of loop information */ exec_freq_state execfreq_state; /**< state of execution freqency information */ + ir_class_cast_state class_cast_state; /**< kind of cast operations in code. */ /* -- Fields for construction -- */ #if USE_EXPLICIT_PHI_IN_STACK @@ -376,7 +378,8 @@ _get_irg_outs_state(const ir_graph *irg) { static INLINE void _set_irg_outs_inconsistent(ir_graph *irg) { - irg->outs_state = outs_inconsistent; + if (irg->outs_state == outs_consistent) + irg->outs_state = outs_inconsistent; } static INLINE irg_dom_state diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 1184f29ff..cf5ce9016 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -961,7 +961,7 @@ static ir_node *equivalent_node_Conv(ir_node *n) /** * A Cast may be removed if the type of the previous node - * is already to type of the Cast. + * is already the type of the Cast. */ static ir_node *equivalent_node_Cast(ir_node *n) { ir_node *pred = get_Cast_op(n); diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index 37e73edbd..b30dac877 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -83,6 +83,7 @@ ir_prog *new_ir_prog (void) { res->outs_state = outs_none; res->ip_outedges = NULL; res->trouts_state = outs_none; + res->class_cast_state = ir_class_casts_transitive; return res; } diff --git a/ir/ir/irprog_t.h b/ir/ir/irprog_t.h index d1520381a..c03475b6e 100644 --- a/ir/ir/irprog_t.h +++ b/ir/ir/irprog_t.h @@ -76,6 +76,8 @@ struct ir_prog { irp_temperature_state temperature_state; /**< accumulated temperatures computed? */ exec_freq_state execfreq_state; /**< State of execution freqency information */ loop_nesting_depth_state lnd_state; /**< State of loop nesting depth information. */ + ir_class_cast_state class_cast_state; /**< kind of cast operations in code. */ + #ifdef DEBUG_libfirm long max_node_nr; /**< to generate unique numbers for nodes. */ #endif -- 2.20.1