Eliminate SET_BASIC_BLOCK macro.

gcc/
	* 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.

From-SVN: r205821
This commit is contained in:
David Malcolm 2013-12-09 20:02:33 +00:00 committed by David Malcolm
parent ea19eb9fba
commit 557c4b493b
7 changed files with 25 additions and 14 deletions

View File

@ -1,3 +1,15 @@
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...

View File

@ -333,7 +333,6 @@ struct GTY(()) control_flow_graph {
#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) \

View File

@ -153,8 +153,8 @@ compact_blocks (void)
{
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 ();
@ -165,14 +165,14 @@ compact_blocks (void)
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);
}
@ -183,7 +183,7 @@ void
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

View File

@ -331,7 +331,7 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
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);

View File

@ -1601,7 +1601,7 @@ df_compact_blocks (void)
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++;
}
@ -1609,7 +1609,7 @@ df_compact_blocks (void)
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)
@ -1645,10 +1645,10 @@ df_bb_replace (int old_index, basic_block new_block)
}
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);
}

View File

@ -4663,8 +4663,8 @@ create_block_for_bookkeeping (edge e1, edge e2)
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),

View File

@ -610,7 +610,7 @@ create_bb (void *h, void *e, basic_block after)
}
/* 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++;