[patch] tree-cfg.c: Remove unused functions.

Kazu Hirata kazu@cs.umass.edu
Sun Nov 7 18:00:00 GMT 2004


Hi,

Attached is a patch to remove last_stmt_ptr and bsi_move_to_bb_end as
they are unused.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-11-07  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-cfg.c (last_stmt_ptr, bsi_move_to_bb_end): Remove.
	* tree-flow.h: Remove the corresponding prototypes.

Index: tree-cfg.c
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/tree-cfg.c,v
retrieving revision 2.100
diff -u -d -p -r2.100 tree-cfg.c
--- tree-cfg.c	4 Nov 2004 22:07:37 -0000	2.100
+++ tree-cfg.c	7 Nov 2004 06:46:54 -0000
@@ -2559,17 +2559,6 @@ last_stmt (basic_block bb)
   return !bsi_end_p (b) ? bsi_stmt (b) : NULL_TREE;
 }
 
-
-/* Return a pointer to the last statement in block BB.  */
-
-tree *
-last_stmt_ptr (basic_block bb)
-{
-  block_stmt_iterator last = bsi_last (bb);
-  return !bsi_end_p (last) ? bsi_stmt_ptr (last) : NULL;
-}
-
-
 /* Return the last statement of an otherwise empty block.  Return NULL
    if the block is totally empty, or if it contains more than one
    statement.  */
@@ -2717,22 +2706,6 @@ bsi_move_before (block_stmt_iterator *fr
   bsi_insert_before (to, stmt, BSI_SAME_STMT);
 }
 
-
-/* Move the statement at FROM to the end of basic block BB.  */
-
-void
-bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb)
-{
-  block_stmt_iterator last = bsi_last (bb);
-  
-  /* Have to check bsi_end_p because it could be an empty block.  */
-  if (!bsi_end_p (last) && is_ctrl_stmt (bsi_stmt (last)))
-    bsi_move_before (from, &last);
-  else
-    bsi_move_after (from, &last);
-}
-
-
 /* Replace the contents of the statement pointed to by iterator BSI
    with STMT.  If PRESERVE_EH_INFO is true, the exception handling
    information of the original statement is preserved.  */
Index: tree-flow.h
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/tree-flow.h,v
retrieving revision 2.58
diff -u -d -p -r2.58 tree-flow.h
--- tree-flow.h	2 Nov 2004 00:23:04 -0000	2.58
+++ tree-flow.h	7 Nov 2004 06:46:54 -0000
@@ -421,7 +421,6 @@ static inline tree * bsi_stmt_ptr (block
 extern void bsi_remove (block_stmt_iterator *);
 extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
 extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
-extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
 
 enum bsi_iterator_update
 {
@@ -470,7 +469,6 @@ extern void group_case_labels (void);
 extern bool cleanup_tree_cfg (void);
 extern tree first_stmt (basic_block);
 extern tree last_stmt (basic_block);
-extern tree *last_stmt_ptr (basic_block);
 extern tree last_and_only_stmt (basic_block);
 extern edge find_taken_edge (basic_block, tree);
 extern void cfg_remove_useless_stmts (void);



More information about the Gcc-patches mailing list