more state handling
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 29 Apr 2005 12:18:36 +0000 (12:18 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 29 Apr 2005 12:18:36 +0000 (12:18 +0000)
[r5746]

ir/ir/irgraph.c
ir/ir/irgraph_t.h
ir/ir/iropt.c
ir/ir/irprog.c
ir/ir/irprog_t.h

index f372e50..6b4b144 100644 (file)
@@ -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;
index 622d89f..ffff2ff 100644 (file)
@@ -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
index 1184f29..cf5ce90 100644 (file)
@@ -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);
index 37e73ed..b30dac8 100644 (file)
@@ -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;
 }
index d152038..c03475b 100644 (file)
@@ -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