Remove keep-edge hacks for endless loop.
[libfirm] / ir / ir / irgmod.c
index be77a7a..3731be5 100644 (file)
 #include "irtools.h"
 #include "error.h"
 
-/**
- * Turns a node into a "useless" Tuple.  The Tuple just forms a tuple
- * from several inputs.
- * This is useful if a node returning a tuple is removed, but the Projs
- * extracting values from the tuple are not available.
- */
 void turn_into_tuple(ir_node *node, int arity)
 {
        ir_graph *irg = get_irn_irg(node);
@@ -57,11 +51,6 @@ void turn_into_tuple(ir_node *node, int arity)
        set_irn_op(node, op_Tuple);
 }
 
-/**
- * Insert irnode `new' in place of irnode `old'
- * Since `new' may be bigger than `old' replace `old'
- * by an op_Id which is smaller than everything.
- */
 void exchange(ir_node *old, ir_node *nw)
 {
        ir_graph *irg;
@@ -113,14 +102,10 @@ void exchange(ir_node *old, ir_node *nw)
        }
 
        /* update irg flags */
-       clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_OUTS
-                          | IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
+       clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS
+                          | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
 }
 
-/*--------------------------------------------------------------------*/
-/*  Functionality for collect_phis                                    */
-/*--------------------------------------------------------------------*/
-
 /**
  * Walker: links all Phi nodes to their Blocks lists,
  *         all Proj nodes to there predecessors.
@@ -151,10 +136,6 @@ void collect_phiprojs(ir_graph *irg)
        irg_walk_graph(irg, firm_clear_node_and_phi_links, collect_phiprojs_walker, NULL);
 }
 
-/*--------------------------------------------------------------------*/
-/*  Functionality for part_block                                      */
-/*--------------------------------------------------------------------*/
-
 /**
  * Moves node and all predecessors of node from from_bl to to_bl.
  * Does not move predecessors of Phi nodes (or block nodes).
@@ -190,8 +171,6 @@ static void move(ir_node *node, ir_node *from_bl, ir_node *to_bl)
 
 static void move_projs(const ir_node *node, ir_node *to_bl)
 {
-       const ir_edge_t *edge;
-
        if (get_irn_mode(node) != mode_T)
                return;
 
@@ -270,13 +249,9 @@ void part_block(ir_node *node)
 
 ir_node *part_block_edges(ir_node *node)
 {
-       ir_graph        *irg       = get_irn_irg(node);
-       ir_node         *old_block = get_nodes_block(node);
-       ir_node         *new_block = new_r_Block(irg,
-                                                get_Block_n_cfgpreds(old_block),
-                                                get_Block_cfgpred_arr(old_block));
-       const ir_edge_t *edge;
-       const ir_edge_t *next;
+       ir_graph *irg       = get_irn_irg(node);
+       ir_node  *old_block = get_nodes_block(node);
+       ir_node  *new_block = new_r_Block(irg, get_Block_n_cfgpreds(old_block), get_Block_cfgpred_arr(old_block));
 
        /* old_block has no predecessors anymore for now */
        set_irn_in(old_block, 0, NULL);
@@ -285,7 +260,7 @@ ir_node *part_block_edges(ir_node *node)
        move_edges(node, old_block, new_block);
 
        /* move Phi nodes to new_block */
-       foreach_out_edge_safe(old_block, edge, next) {
+       foreach_out_edge_safe(old_block, edge) {
                ir_node *phi = get_edge_src_irn(edge);
                if (!is_Phi(phi))
                        continue;