return NULL;
}
-/* Returns true when BB has an incoming edge exiting LOOP. */
+/* Returns incoming edge when BB has an incoming edge exiting LOOP, else return
+ NULL. */
-bool
+edge
loop_exits_to_bb_p (class loop *loop, basic_block bb)
{
edge e;
FOR_EACH_EDGE (e, ei, bb->preds)
if (loop_exit_edge_p (loop, e))
- return true;
+ return e;
- return false;
+ return NULL;
}
-/* Returns true when BB has an outgoing edge exiting LOOP. */
+/* Returns outgoing edge when BB has an outgoing edge exiting LOOP, else return
+ NULL. */
-bool
+edge
loop_exits_from_bb_p (class loop *loop, basic_block bb)
{
edge e;
FOR_EACH_EDGE (e, ei, bb->succs)
if (loop_exit_edge_p (loop, e))
- return true;
+ return e;
- return false;
+ return NULL;
}
/* Return location corresponding to the loop control condition if possible. */
extern int average_num_loop_insns (const class loop *);
extern unsigned get_loop_level (const class loop *);
extern bool loop_exit_edge_p (const class loop *, const_edge);
-extern bool loop_exits_to_bb_p (class loop *, basic_block);
-extern bool loop_exits_from_bb_p (class loop *, basic_block);
+extern edge loop_exits_to_bb_p (class loop *, basic_block);
+extern edge loop_exits_from_bb_p (class loop *, basic_block);
extern void mark_loop_exit_edges (void);
extern dump_user_location_t get_loop_location (class loop *loop);