size_t n_preds;
ir_node *next;
ir_node *phi;
- ir_node **new_in;
ir_graph *irg;
assert(is_Block(block));
/* create final in-array for the block */
if (block->attr.block.dynamic_ins) {
- new_in = NEW_ARR_D(ir_node*, get_irg_obstack(irg), n_preds + 1);
- memcpy(new_in, block->in, (n_preds+1) * sizeof(new_in[0]));
+ ir_node **const new_in = DUP_ARR_D(ir_node*, get_irg_obstack(irg), block->in);
DEL_ARR_F(block->in);
block->in = new_in;
block->attr.block.dynamic_ins = false;
set_Block_block_visited(res, 0);
/* Create and initialize array for Phi-node construction. */
- res->attr.block.graph_arr = NEW_ARR_D(ir_node*, get_irg_obstack(irg), irg->n_loc);
- memset(res->attr.block.graph_arr, 0, sizeof(ir_node*) * irg->n_loc);
+ res->attr.block.graph_arr = NEW_ARR_DZ(ir_node*, get_irg_obstack(irg), irg->n_loc);
/* Immature block may not be optimized! */
irn_verify_irg(res, irg);
set_Block_matured(res, 1);
/* Create and initialize array for Phi-node construction. */
if (irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_CONSTRUCTION)) {
- res->attr.block.graph_arr = NEW_ARR_D(ir_node*, get_irg_obstack(irg), irg->n_loc);
- memset(res->attr.block.graph_arr, 0, irg->n_loc * sizeof(ir_node*));
+ res->attr.block.graph_arr = NEW_ARR_DZ(ir_node*, get_irg_obstack(irg), irg->n_loc);
}
irn_verify_irg(res, irg);
return res;