added missing parameter and initializer
[libfirm] / ir / ir / iropt.c
index 1d0d54a..b0bb50f 100644 (file)
@@ -773,8 +773,8 @@ static ir_node *equivalent_node_Block(ir_node *n)
     }
   }
   else if (get_opt_unreachable_code() &&
-           (n != current_ir_graph->start_block) &&
-           (n != current_ir_graph->end_block)     ) {
+           (n != get_irg_start_block(current_ir_graph)) &&
+           (n != get_irg_end_block(current_ir_graph))    ) {
     int i;
 
     /* If all inputs are dead, this block is dead too, except if it is
@@ -1202,8 +1202,8 @@ static ir_node *equivalent_node_Phi(ir_node *n)
   /* @@@ fliegt 'raus, sollte aber doch immer wahr sein!!!
      assert(get_irn_arity(block) == n_preds && "phi in wrong block!"); */
   if ((is_Block_dead(block)) ||                  /* Control dead */
-      (block == current_ir_graph->start_block))  /* There should be no Phi nodes */
-    return new_Bad();                            /* in the Start Block. */
+      (block == get_irg_start_block(current_ir_graph)))  /* There should be no Phi nodes */
+    return new_Bad();                                    /* in the Start Block. */
 
   if (n_preds == 0) return n;           /* Phi of dead Region without predecessors. */
 
@@ -2398,7 +2398,7 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj)
       proj_nr = get_inversed_pnc(proj_nr);
       changed |= 1;
     }
-    else if (left > right) {
+    else if (get_irn_idx(left) > get_irn_idx(right)) {
       ir_node *t = left;
 
       left  = right;
@@ -3382,7 +3382,7 @@ identify (pset *value_table, ir_node *n)
       ir_node *r = get_binop_right(n);
 
       /* for commutative operators perform  a OP b == b OP a */
-      if (l > r) {
+      if (get_irn_idx(l) > get_irn_idx(r)) {
         set_binop_left(n, r);
         set_binop_right(n, l);
       }
@@ -3580,7 +3580,7 @@ optimize_node(ir_node *n)
         edges_node_deleted(n, current_ir_graph);
 
         /* evaluation was successful -- replace the node. */
-        obstack_free(current_ir_graph->obst, n);
+        irg_kill_node(current_ir_graph, n);
         nw = new_Const(get_tarval_mode (tv), tv);
 
         if (old_tp && get_type_mode(old_tp) == get_tarval_mode (tv))
@@ -3615,8 +3615,7 @@ optimize_node(ir_node *n)
     edges_node_deleted(oldn, current_ir_graph);
 
     /* We found an existing, better node, so we can deallocate the old node. */
-    obstack_free (current_ir_graph->obst, oldn);
-
+    irg_kill_node(current_ir_graph, oldn);
     return n;
   }