This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] FOR_EACH_RTX construct to replace for_each_rtx
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Richard Henderson <rth at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 Jan 2005 09:09:35 +0100
- Subject: Re: [PATCH] FOR_EACH_RTX construct to replace for_each_rtx
- References: <41EE99B0.firstname.lastname@example.org> <20050119190053.GD8144@redhat.com>
I don't like the fact that this isn't an exact drop-in replacement
of FOR_EACH_RTX. I very much feel that the first version of this
change to be installed should support *exactly* the same interface.
This is not exactly possible; for_each_rtx has a return value,
FOR_EACH_RTX cannot for obvious reasons.
Nor should you have done any simultaneous renamings of functions.
Keeping the for_each_rtx idiom of using global variables or
structs-for-parameters (a la replace_label) would not have improved
readability. I tried to be as thorough as I could in the changelog.
Basically, the changes are:
- wrap the body of the xxx_1 function in FOR_EACH_RTX
- change "return -1" to "rtx_skip_iter (&iter); continue;"
- change "return 0" to "continue;"
- leave other returns in place
- remove the for_each_rtx in the caller (typically lacking a _1 suffix)
- if that was all the caller did, rename the function and polish the way
the "data" parameter is handled.
As I said, I actually did not think to do this for 4.0, which also made
me more liberal in polishing the resulting code.