Commit f3522a84 by Kazu Hirata Committed by Kazu Hirata

basic-block.h (ei_cond): New.

	* basic-block.h (ei_cond): New.
	(FOR_EACH_EDGE): Call ei_cond.

From-SVN: r98769
parent 44ecf603
2005-04-26 Kazu Hirata <kazu@cs.umass.edu>
* basic-block.h (ei_cond): New.
(FOR_EACH_EDGE): Call ei_cond.
2005-04-25 Roger Sayle <roger@eyesopen.com> 2005-04-25 Roger Sayle <roger@eyesopen.com>
* sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat
......
...@@ -736,6 +736,25 @@ ei_safe_edge (edge_iterator i) ...@@ -736,6 +736,25 @@ ei_safe_edge (edge_iterator i)
return !ei_end_p (i) ? ei_edge (i) : NULL; return !ei_end_p (i) ? ei_edge (i) : NULL;
} }
/* Return 1 if we should continue to iterate. Return 0 otherwise.
*Edge P is set to the next edge if we are to continue to iterate
and NULL otherwise. */
static inline bool
ei_cond (edge_iterator ei, edge *p)
{
if (!ei_end_p (ei))
{
*p = ei_edge (ei);
return 1;
}
else
{
*p = NULL;
return 0;
}
}
/* This macro serves as a convenient way to iterate each edge in a /* This macro serves as a convenient way to iterate each edge in a
vector of predecessor or successor edges. It must not be used when vector of predecessor or successor edges. It must not be used when
an element might be removed during the traversal, otherwise an element might be removed during the traversal, otherwise
...@@ -751,9 +770,9 @@ ei_safe_edge (edge_iterator i) ...@@ -751,9 +770,9 @@ ei_safe_edge (edge_iterator i)
} }
*/ */
#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ #define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \
for ((EDGE) = NULL, (ITER) = ei_start ((EDGE_VEC)); \ for ((ITER) = ei_start ((EDGE_VEC)); \
((EDGE) = ei_safe_edge ((ITER))); \ ei_cond ((ITER), &(EDGE)); \
ei_next (&(ITER))) ei_next (&(ITER)))
struct edge_list * create_edge_list (void); struct edge_list * create_edge_list (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment