summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/basic-block.h1
-rw-r--r--gcc/cfg.c10
-rw-r--r--gcc/cfgrtl.c2
-rw-r--r--gcc/df-core.c8
-rw-r--r--gcc/sel-sched.c4
-rw-r--r--gcc/tree-cfg.c2
7 files changed, 25 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c5b509ded8c..6ee43fe1197 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,17 @@
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...
(profile_status_for_fn): ...this.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index da93c6fbca8..f759e278973 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -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) \
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 786fe4838ff..f3861688a12 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -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
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 63f44afbbae..045d78b7453 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -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);
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 37876af7b01..4fb92a96f54 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -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);
}
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 1e3fcf0da5a..1195f7e6c19 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -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),
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 6c2cc16b8b6..2d7916bde5a 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -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++;