diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-21 00:20:02 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-21 00:20:02 +0000 |
commit | 749ea85f0162cbb4f17e2c28b779260bc3a6da36 (patch) | |
tree | 5936129bd622c7aef21ba556b43971c620090ebd /gcc/cfgloop.c | |
parent | 6be83e11b7b2d28522bc0d005448633ffd9abd1f (diff) | |
download | gcc-749ea85f0162cbb4f17e2c28b779260bc3a6da36.tar.gz |
* tree-ssa-loop-im.c (schedule_sm, determine_lsm_ref,
hoist_memory_references, loop_suitable_for_sm, determine_lsm_loop):
Use vector of edges instead of array.
* tree-ssa-loop-niter.c (find_loop_niter, find_loop_niter_by_eval,
estimate_numbers_of_iterations_loop): Ditto.
* predict.c (predict_loops): Ditto.
* loop-unroll.c (analyze_insns_in_loop): Ditto.
* tree-ssa-threadupdate.c: Remove declaration of heap allocation for
edge vectors.
* basic-block.h: Declare heap allocation for edge vectors.
* tree-outof-ssa.c: Ditto.
* cfgloop.c (get_loop_exit_edges): Return vector of edges.
* cfgloop.h (get_loop_exit_edges): Declaration changed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r-- | gcc/cfgloop.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 25549db5b94..4a5631df081 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -881,30 +881,24 @@ get_loop_body_in_bfs_order (const struct loop *loop) return blocks; } -/* Gets exit edges of a LOOP, returning their number in N_EDGES. */ -edge * -get_loop_exit_edges (const struct loop *loop, unsigned int *num_edges) +/* Returns the list of the exit edges of a LOOP. */ + +VEC (edge, heap) * +get_loop_exit_edges (const struct loop *loop) { - edge *edges, e; - unsigned i, n; - basic_block * body; + VEC (edge, heap) *edges = NULL; + edge e; + unsigned i; + basic_block *body; edge_iterator ei; gcc_assert (loop->latch != EXIT_BLOCK_PTR); body = get_loop_body (loop); - n = 0; - for (i = 0; i < loop->num_nodes; i++) - FOR_EACH_EDGE (e, ei, body[i]->succs) - if (!flow_bb_inside_loop_p (loop, e->dest)) - n++; - edges = XNEWVEC (edge, n); - *num_edges = n; - n = 0; for (i = 0; i < loop->num_nodes; i++) FOR_EACH_EDGE (e, ei, body[i]->succs) if (!flow_bb_inside_loop_p (loop, e->dest)) - edges[n++] = e; + VEC_safe_push (edge, heap, edges, e); free (body); return edges; |