#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);
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;
}
/* 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.
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).
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;
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);
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;