Commit 57c32f8c authored by Christoph Mallon's avatar Christoph Mallon
Browse files

array: Use DUP_ARR_D().

parent 1209ae49
......@@ -59,8 +59,6 @@ static ir_node **compute_df(ir_node *blk, ir_dom_front_info_t *info)
{
ir_node *c;
ir_node **df_list = NEW_ARR_F(ir_node *, 0);
ir_node **df;
size_t len;
/* Add local dominance frontiers */
foreach_block_succ(blk, edge) {
......@@ -88,9 +86,7 @@ static ir_node **compute_df(ir_node *blk, ir_dom_front_info_t *info)
}
/* now copy the flexible array to the obstack */
len = ARR_LEN(df_list);
df = NEW_ARR_D(ir_node *, &info->obst, len);
memcpy(df, df_list, len * sizeof(df[0]));
ir_node **const df = DUP_ARR_D(ir_node*, &info->obst, df_list);
DEL_ARR_F(df_list);
pmap_insert(info->df_map, blk, df);
......
......@@ -311,7 +311,6 @@ void mature_immBlock(ir_node *block)
size_t n_preds;
ir_node *next;
ir_node *phi;
ir_node **new_in;
ir_graph *irg;
assert(is_Block(block));
......@@ -340,8 +339,7 @@ void mature_immBlock(ir_node *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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment