bearch: Disallow passing Projs to get_irn_ops().
[libfirm] / ir / ir / irssacons.c
index 794b0fc..f251dc8 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -39,13 +25,12 @@ static void (*ssa_cons_walker)(ir_graph *, irg_walk_func *, irg_walk_func *, voi
  */
 static void prepare_blocks(ir_node *block, void *env)
 {
-       unsigned        n_loc = current_ir_graph->n_loc;
-       struct obstack *obst  = current_ir_graph->obst;
+       ir_graph *const irg   = get_Block_irg(block);
+       unsigned  const n_loc = irg->n_loc;
        (void)env;
        /* reset mature flag */
        set_Block_matured(block, 0);
-       block->attr.block.graph_arr = NEW_ARR_D(ir_node *, obst, n_loc);
-       memset(block->attr.block.graph_arr, 0, sizeof(ir_node*) * n_loc);
+       block->attr.block.graph_arr = NEW_ARR_DZ(ir_node*, get_irg_obstack(irg), n_loc);
        set_Block_phis(block, NULL);
 }