diff options
| author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 14:27:35 +0000 |
|---|---|---|
| committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 14:27:35 +0000 |
| commit | 3df28fc8f7040a167fd926704a7cd0ccbcf2364a (patch) | |
| tree | d84d375ad74f53f9af91c2ba68d00078af10d7f6 | |
| parent | ed8713787eb0d64e5f80fbe33a9f48903de50c99 (diff) | |
| download | ppe42-gcc-3df28fc8f7040a167fd926704a7cd0ccbcf2364a.tar.gz ppe42-gcc-3df28fc8f7040a167fd926704a7cd0ccbcf2364a.zip | |
* basic-block.h (ei_cond): New.
(FOR_EACH_EDGE): Call ei_cond.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98769 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/basic-block.h | 25 |
2 files changed, 27 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 06506ed977e..74a7b894c48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 6f295136d29..baca9d7e9e8 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -736,6 +736,25 @@ ei_safe_edge (edge_iterator i) 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 vector of predecessor or successor edges. It must not be used when an element might be removed during the traversal, otherwise @@ -751,9 +770,9 @@ ei_safe_edge (edge_iterator i) } */ -#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ - for ((EDGE) = NULL, (ITER) = ei_start ((EDGE_VEC)); \ - ((EDGE) = ei_safe_edge ((ITER))); \ +#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ + for ((ITER) = ei_start ((EDGE_VEC)); \ + ei_cond ((ITER), &(EDGE)); \ ei_next (&(ITER))) struct edge_list * create_edge_list (void); |

