Patchwork tidy alloc_aux_for_* interface

login
register
mail settings
Submitter Nathan Froyd
Date Aug. 10, 2010, 1:02 p.m.
Message ID <20100810130219.GO4130@codesourcery.com>
Download mbox | patch
Permalink /patch/61378/
State New
Headers show

Comments

Nathan Froyd - Aug. 10, 2010, 1:02 p.m.
This patch does two things:

- alloc_aux_for_block (resp. edge) are only called from
  alloc_aux_for_blocks (resp. edges), so it doesn't need to be an
  exported interface.

- The FOR_ALL_BB_BETWEEN iteration is exactly equivalent to FOR_ALL_BB,
  so use that instead in the interest of clarity.

Tested on x86_64-unknown-linux-gnu.  OK to commit?

-Nathan

	* basic-block.h (alloc_aux_for_block, alloc_aux_for_edge): Delete.
	* cfg.c (alloc_aux_for_block, alloc_aux_for_edge): Make static.
	(alloc_aux_for_blocks, clear_aux_for_blocks): Use FOR_ALL_BB.
Richard Henderson - Aug. 10, 2010, 2:24 p.m.
On 08/10/2010 06:02 AM, Nathan Froyd wrote:
> 	* basic-block.h (alloc_aux_for_block, alloc_aux_for_edge): Delete.
> 	* cfg.c (alloc_aux_for_block, alloc_aux_for_edge): Make static.
> 	(alloc_aux_for_blocks, clear_aux_for_blocks): Use FOR_ALL_BB.

Ok.


r~

Patch

diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 1bf192d..692ebe6 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -783,11 +783,9 @@  extern void link_block (basic_block, basic_block);
 extern void unlink_block (basic_block);
 extern void compact_blocks (void);
 extern basic_block alloc_block (void);
-extern void alloc_aux_for_block (basic_block, int);
 extern void alloc_aux_for_blocks (int);
 extern void clear_aux_for_blocks (void);
 extern void free_aux_for_blocks (void);
-extern void alloc_aux_for_edge (edge, int);
 extern void alloc_aux_for_edges (int);
 extern void clear_aux_for_edges (void);
 extern void free_aux_for_edges (void);
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 127f08c..3a82d93 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -735,7 +735,7 @@  static void *first_edge_aux_obj = 0;
 /* Allocate a memory block of SIZE as BB->aux.  The obstack must
    be first initialized by alloc_aux_for_blocks.  */
 
-void
+static void
 alloc_aux_for_block (basic_block bb, int size)
 {
   /* Verify that aux field is clear.  */
@@ -766,7 +766,7 @@  alloc_aux_for_blocks (int size)
     {
       basic_block bb;
 
-      FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+      FOR_ALL_BB (bb)
       alloc_aux_for_block (bb, size);
     }
 }
@@ -778,7 +778,7 @@  clear_aux_for_blocks (void)
 {
   basic_block bb;
 
-  FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+  FOR_ALL_BB (bb)
     bb->aux = NULL;
 }
 
@@ -798,7 +798,7 @@  free_aux_for_blocks (void)
 /* Allocate a memory edge of SIZE as BB->aux.  The obstack must
    be first initialized by alloc_aux_for_edges.  */
 
-void
+static void
 alloc_aux_for_edge (edge e, int size)
 {
   /* Verify that aux field is clear.  */