irgmod: Pass the new inputs to turn_into_tuple() instead of initialising them with...
[libfirm] / ir / be / betranshlp.c
index dcf3ead..32f346e 100644 (file)
@@ -90,7 +90,7 @@ void be_duplicate_deps(ir_node *old_node, ir_node *new_node)
 ir_node *be_transform_phi(ir_node *node, const arch_register_req_t *req)
 {
        ir_node  *block = be_transform_node(get_nodes_block(node));
-       ir_graph *irg   = current_ir_graph;
+       ir_graph *irg   = get_Block_irg(block);
        dbg_info *dbgi  = get_irn_dbg_info(node);
 
        /* phi nodes allow loops, so we use the old arguments for now
@@ -379,10 +379,8 @@ void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func)
        current_ir_graph = irg;
 
        /* create a new obstack */
-       struct obstack *old_obst = irg->obst;
-       struct obstack *new_obst = XMALLOC(struct obstack);
-       obstack_init(new_obst);
-       irg->obst = new_obst;
+       struct obstack old_obst = irg->obst;
+       obstack_init(&irg->obst);
        irg->last_node_idx = 0;
 
        free_vrp_data(irg);
@@ -394,8 +392,7 @@ void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func)
        transform_nodes(irg, func);
 
        /* free the old obstack */
-       obstack_free(old_obst, 0);
-       xfree(old_obst);
+       obstack_free(&old_obst, 0);
 
        /* restore state */
        current_ir_graph = old_current_ir_graph;