This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: RTL iterators
On Fri, Aug 10, 2001 at 12:15:17AM -0400, Daniel Berlin wrote:
> I would argue this is not true.
You'd be wrong.
> for_each_rtx is from August, 1998.
So? How much code is still hanging around from 1990?
More than you think, that's for sure.
> Since then, the only place it's been used is the SSA stuff.
Grep again. It's used in quite a few places.
> > I can't see how "next" is by itself meaningful in any way.
> You've taken it out of context, of course.
> You missed there's a cookie...
Clearly you missed my point entirely.
> I.E.
> (set (reg:SI a) (reg:SI b))
> get_next_REG would first hand you (reg:SI a), then (reg:SI b), then NULL.
Yeah, so? Did you skip over the "I want Sets" or "I want Uses"
part of my query? I disbelieve "I want any reg whatsoever" is
used nearly as often.
> >of the time we need to know whether "X" is read, set, or clobbered.
> while ((rtx = get_next_SET (insn, cookie)) != NULL)
> {
> if (SET_DEST (rtx) == X)
> /* It's written */
> else if (SET_SRC (rtx) == X)
> /* It's read */
> }
> (Best I can do, or anyone could do, without knowing what *type* of X
> you are looking for.)
Have to work harder than that. See, at minimum, note_stores.
> Why? Because it's easier, and there is nothing better about writing
> tons of small callbacks.
Oh I'd agree that it would be easier. What I disagree with is
that the code that you've written is good enough.
r~