This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcc-3_4-basic-improvements-branch] cfgloop.c: Remove unusedfunctions.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Sep 2002 13:07:21 -0400 (EDT)
- Subject: [gcc-3_4-basic-improvements-branch] cfgloop.c: Remove unusedfunctions.
Hi,
Attached is a patch to remove unused functions.
Bootstrapped on i386-redhat-linux. OK to apply to
gcc-3.4-basic-improvements-branch?
By the way, I found the following two functions are also unused, but
they seem to be provided for completeness, so I am not removing them.
flow_loop_tree_node_remove
flow_loops_update
Kazu Hirata
2002-09-17 Kazu Hirata <kazu@cs.umass.edu>
* cfgloop.c (add_bb_to_loop): Remove.
(remove_bb_from_loops): Likewise.
(find_common_loop): Likewise.
(loop_preheader_edge): Likewise.
* basic-block.h: Remove corresponding prototypes.
Index: cfgloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.15.6.1
diff -u -r1.15.6.1 cfgloop.c
--- cfgloop.c 4 Sep 2002 23:48:59 -0000 1.15.6.1
+++ cfgloop.c 17 Sep 2002 14:30:04 -0000
@@ -1018,58 +1018,6 @@
return tovisit;
}
-/* Adds basic block BB to LOOP. */
-void
-add_bb_to_loop (bb, loop)
- basic_block bb;
- struct loop *loop;
- {
- int i;
-
- bb->loop_father = loop;
- bb->loop_depth = loop->depth;
- loop->num_nodes++;
- for (i = 0; i < loop->depth; i++)
- loop->pred[i]->num_nodes++;
- }
-
-/* Remove basic block BB from loops. */
-void
-remove_bb_from_loops (bb)
- basic_block bb;
- {
- int i;
- struct loop *loop = bb->loop_father;
-
- loop->num_nodes--;
- for (i = 0; i < loop->depth; i++)
- loop->pred[i]->num_nodes--;
- bb->loop_father = NULL;
- bb->loop_depth = 0;
- }
-
-/* Finds nearest common ancestor in loop tree for given loops. */
-struct loop *
-find_common_loop (loop_s, loop_d)
- struct loop *loop_s;
- struct loop *loop_d;
-{
- if (!loop_s) return loop_d;
- if (!loop_d) return loop_s;
-
- if (loop_s->depth < loop_d->depth)
- loop_d = loop_d->pred[loop_s->depth];
- else if (loop_s->depth > loop_d->depth)
- loop_s = loop_s->pred[loop_d->depth];
-
- while (loop_s != loop_d)
- {
- loop_s = loop_s->outer;
- loop_d = loop_d->outer;
- }
- return loop_s;
-}
-
/* Checks that LOOPS are allright:
-- sizes of loops are allright
-- results of get_loop_body really belong to the loop
@@ -1183,17 +1131,3 @@
return e;
}
-
-/* Returns preheader edge of LOOP. */
-edge
-loop_preheader_edge (loop)
- struct loop *loop;
-{
- edge e;
-
- for (e = loop->header->pred; e->src == loop->latch; e = e->pred_next)
- continue;
-
- return e;
-}
-
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.158.4.1
diff -u -r1.158.4.1 basic-block.h
--- basic-block.h 8 Sep 2002 10:43:36 -0000 1.158.4.1
+++ basic-block.h 17 Sep 2002 14:30:05 -0000
@@ -762,12 +762,7 @@
bool (*)(basic_block, void *),
basic_block *, int, void *));
-extern edge loop_preheader_edge PARAMS ((struct loop *));
extern edge loop_latch_edge PARAMS ((struct loop *));
-
-extern void add_bb_to_loop PARAMS ((basic_block, struct loop *));
-extern void remove_bb_from_loops PARAMS ((basic_block));
-extern struct loop * find_common_loop PARAMS ((struct loop *, struct loop *));
extern void verify_loop_structure PARAMS ((struct loops *, int));
#define VLS_EXPECT_PREHEADERS 1