This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] New function: current_function_has_landing_pads
- From: Roger Sayle <roger at eyesopen dot com>
- To: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 26 Jun 2005 16:08:36 -0600 (MDT)
- Subject: Re: [PATCH] New function: current_function_has_landing_pads
On Wed, 22 Jun 2005, Andreas Krebbel wrote:
> 2005-06-22 Andreas Krebbel <krebbel1@de.ibm.com>
>
> * except.c (current_function_has_landing_pads): New function.
> * except.h (current_function_has_landing_pads): Prototype added.
This is OK for mainline.
I appreciate that the new function is heavily based upon the existing
current_function_has_exception_handlers, but I think both may benefit
from some minor clean-ups. Firstly, neither function has a comment
above them describing what they do. For example, clarifying that this
predicate does/doesn't test for post-landing pads. In fact, except.c
seems to be particularly poor with respect to per function documentation,
which presumably must be a source of some embarrassment to the unfortunate
contributor named at the top of the source file :) The large comment
at the top of the file describes what an exception is, but fails to
clarify how they are implemented, for example describing what a landing
pad is.
Secondly,
> + if (! region || region->region_number != i)
> + continue;
> + if (region->landing_pad)
> + return true;
Is perhaps marginally clearer written as
if (region
&& region->region_number == i
&& region->landing_pad)
return true;
Again the "continue" idiom is commonly used in except.c, but for functions
as short as this, either form is acceptable.
Hence, if you feel at all motivated to clean-up some of these quirks, I'll
pre-approve a follow-up patch to do so (or to document any other functions
in except.c!).
Many thanks in advance,
Roger
--