+2013-12-09 David Malcolm <dmalcolm@redhat.com>
+
+ * basic-block.h (SET_BASIC_BLOCK): Eliminate macro.
+
+ * cfg.c (compact_blocks): Replace uses of SET_BASIC_BLOCK
+ with SET_BASIC_BLOCK_FOR_FN, making use of cfun explicit.
+ (expunge_block): Likewise.
+ * cfgrtl.c (create_basic_block_structure): Likewise.
+ * df-core.c (df_compact_blocks, df_bb_replace): Likewise.
+ * sel-sched.c (create_block_for_bookkeeping): Likewise.
+ * tree-cfg.c (create_bb): Likewise.
+
2013-12-09 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (profile_status_for_function): Rename to...
#define profile_status (cfun->cfg->x_profile_status)
#define BASIC_BLOCK(N) ((*basic_block_info)[(N)])
-#define SET_BASIC_BLOCK(N,BB) ((*basic_block_info)[(N)] = (BB))
/* For iterating over basic blocks. */
#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
{
int i;
- SET_BASIC_BLOCK (ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN (cfun));
- SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN (cfun));
+ SET_BASIC_BLOCK_FOR_FN (cfun, ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN (cfun));
+ SET_BASIC_BLOCK_FOR_FN (cfun, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN (cfun));
if (df)
df_compact_blocks ();
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB (bb)
{
- SET_BASIC_BLOCK (i, bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, i, bb);
bb->index = i;
i++;
}
gcc_assert (i == n_basic_blocks_for_fn (cfun));
for (; i < last_basic_block; i++)
- SET_BASIC_BLOCK (i, NULL);
+ SET_BASIC_BLOCK_FOR_FN (cfun, i, NULL);
}
last_basic_block = n_basic_blocks_for_fn (cfun);
}
expunge_block (basic_block b)
{
unlink_block (b);
- SET_BASIC_BLOCK (b->index, NULL);
+ SET_BASIC_BLOCK_FOR_FN (cfun, b->index, NULL);
n_basic_blocks_for_fn (cfun)--;
/* We should be able to ggc_free here, but we are not.
The dead SSA_NAMES are left pointing to dead statements that are pointing
bb->index = last_basic_block++;
bb->flags = BB_NEW | BB_RTL;
link_block (bb, after);
- SET_BASIC_BLOCK (bb->index, bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, bb->index, bb);
df_bb_refs_record (bb->index, false);
update_bb_for_insn (bb);
BB_SET_PARTITION (bb, BB_UNPARTITIONED);
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB (bb)
{
- SET_BASIC_BLOCK (i, bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, i, bb);
bb->index = i;
i++;
}
gcc_assert (i == n_basic_blocks_for_fn (cfun));
for (; i < last_basic_block; i++)
- SET_BASIC_BLOCK (i, NULL);
+ SET_BASIC_BLOCK_FOR_FN (cfun, i, NULL);
#ifdef DF_DEBUG_CFG
if (!df_lr->solutions_dirty)
}
df_clear_bb_dirty (new_block);
- SET_BASIC_BLOCK (old_index, new_block);
+ SET_BASIC_BLOCK_FOR_FN (cfun, old_index, new_block);
new_block->index = old_index;
df_set_bb_dirty (BASIC_BLOCK (old_index));
- SET_BASIC_BLOCK (new_block_index, NULL);
+ SET_BASIC_BLOCK_FOR_FN (cfun, new_block_index, NULL);
}
new_bb->index = succ->index;
succ->index = i;
- SET_BASIC_BLOCK (new_bb->index, new_bb);
- SET_BASIC_BLOCK (succ->index, succ);
+ SET_BASIC_BLOCK_FOR_FN (cfun, new_bb->index, new_bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, succ->index, succ);
memcpy (&gbi, SEL_GLOBAL_BB_INFO (new_bb), sizeof (gbi));
memcpy (SEL_GLOBAL_BB_INFO (new_bb), SEL_GLOBAL_BB_INFO (succ),
}
/* Add the newly created block to the array. */
- SET_BASIC_BLOCK (last_basic_block, bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, last_basic_block, bb);
n_basic_blocks_for_fn (cfun)++;
last_basic_block++;