*** empty log message ***
[libfirm] / ir / ir / irgmod.c
index 61f549b..3e00e6a 100644 (file)
@@ -6,16 +6,10 @@
 ** irgmod: ir graph modification
 */
 
+# include "irnode_t.h"
 # include "irgmod.h"
 # include "array.h"
 
-/*  ir_node * */
-/*  arg_access (ir_mode *mode, long proj) */
-/*  { */
-/*    return new_r_Proj (current_ir_graph, current_ir_graph->start,  */
-/*                  current_ir_graph->args, mode, proj); */
-/*  } */
-
 /* 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
@@ -28,9 +22,10 @@ turn_into_tuple (ir_node *node, int arity)
   if (get_irn_arity(node) == arity) {
     /* keep old array */
   } else {
-    /* allocate new array, remove old one. */
-    /* !!!??? free old in_array */
+    /* Allocate new array, don't free old in_array, it's on the obstack. */
+    ir_node *block = get_nodes_Block(node);
     node->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, arity+1);
+    set_nodes_Block(node, block);
   }
 }