]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Eliminate SET_BASIC_BLOCK macro.
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 9 Dec 2013 20:02:33 +0000 (20:02 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 9 Dec 2013 20:02:33 +0000 (20:02 +0000)
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

gcc/ChangeLog
gcc/basic-block.h
gcc/cfg.c
gcc/cfgrtl.c
gcc/df-core.c
gcc/sel-sched.c
gcc/tree-cfg.c

index c5b509ded8c51f5681e49feee7dba030252c51f9..6ee43fe119793da50db2dbf13bc54e0f25aff2dc 100644 (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...
index da93c6fbca8edc9af2e949d4460e24bb9594b837..f759e27897382b271ef4ccc5c0430ee478b9f437 100644 (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) \
index 786fe4838fffd2552944ed3566c4bcbd6f19114f..f3861688a12b37d237e7948e4ec0110b180d154f 100644 (file)
--- 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
index 63f44afbbae1eb15c41ba6970e328881005fd2eb..045d78b745353304329b39da166676c220c4bb1f 100644 (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);
index 37876af7b016b65178cbe1c917635e6e00ffe1eb..4fb92a96f5445ad76ddc98e428f4d806668a21eb 100644 (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);
 }
 
 
index 1e3fcf0da5a85f14dcd205792e089b62ee458919..1195f7e6c197ec50af37f482c706159887be2837 100644 (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),
index 6c2cc16b8b6a6e83fab6c555c174a32f1293eed5..2d7916bde5a4f02184616d004d89b13d39494f56 100644 (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++;