1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
6 ** irgmod: ir graph modification
13 /* Turns a node into a "useless" Tuple. The Tuple just forms a tuple
15 This is useful if a node returning a tuple is removed, but the Projs
16 extracting values from the tuple are not available. */
18 turn_into_tuple (ir_node *node, int arity)
21 set_irn_op(node, op_Tuple);
22 if (get_irn_arity(node) == arity) {
25 /* Allocate new array, don't free old in_array, it's on the obstack. */
26 ir_node *block = get_nodes_Block(node);
27 node->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, arity+1);
28 set_nodes_Block(node, block);
32 /* Insert irnode `new' in place of irnode `old'
33 Since `new' may be bigger than `old' replace `old'
34 by an op_Id which is smaller than everything */
36 exchange (ir_node *old, ir_node *new)
38 ir_node *block = old->in[0];
41 old->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, 2);