This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] basic-block.h: Speed up FOR_EACH_EDGE.
- From: Richard Henderson <rth at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 7 Mar 2005 12:58:10 -0800
- Subject: Re: [patch] basic-block.h: Speed up FOR_EACH_EDGE.
- References: <20050301.210353.88490961.kazu@cs.umass.edu>
On Tue, Mar 01, 2005 at 09:03:53PM -0500, Kazu Hirata wrote:
> In order to cram a construct like
>
> for (i = 0; i < length; i++)
> {
> e = EDGE_I (blah, i);
>
> /* Do something eith e. */
> }
> e = NULL;
>
> into a single "for" loop, I created a helper function called ei_cond.
As opposed to (i < length ? e = EDGE_I (blah, i), 1 : 0)?
Kinda gross, I know, but not horrible for burying in macros.
I suppose it doesn't matter.
r~