This is the mail archive of the
mailing list for the GCC project.
Re: [RFC][4.4] Conversion of tree.h STRIP_* macros into static inline functions
- From: Simon Baldwin <simonb at google dot com>
- To: tromey at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Dec 2007 16:33:46 -0800
- Subject: Re: [RFC][4.4] Conversion of tree.h STRIP_* macros into static inline functions
- References: <475EE943.firstname.lastname@example.org> <email@example.com>
Tom Tromey wrote:
"Simon" == Simon Baldwin <firstname.lastname@example.org> writes:
Simon> The attached file, gzipped because it exceeds 100Kb, is a patch
Simon> that converts tree.h STRIP_* macros into static inline
I think it would be good to mark these functions with
__attribute__((warn_unused_result)). Otherwise, I think, it would be
easy to accidentally call one erroneously -- for instance by bringing
in an old-style use when doing a merge.
Thanks for the feedback and suggestion. I'd vaguely considered this as
part of the patch, but didn't do it once I'd convinced myself I'd found
all of the (current) call sites. As you note, though, this neglects
Also, in this particular case, in my opinion, it would be better to
lowercase the function names. This would have the nice effect of
breaking bad code that resulted from a merge.
When the general issue of lowercasing converted and inlined macros came
up a couple of months ago, the overall consensus was to leave them
uppercased, because of disinclination to edit all call sites.
However, all call sites have to be edited for this particular patch
anyway, so there's an argument for lowercasing them.
For the moment, however, I'm inclined to leave them alone. The first
reason is that this may be one of a series of semi-mechanical changes,
so establishing a pattern seems useful. The second, more prosaic, is
that if STRIP_*() are documented anywhere, it'll be their uppercased
versions that are documented; I'd prefer not to break any such
documentation. Or more accurately, I'd prefer not to have to find and
update the documentation!
We can always decide to lowercase these and any other converted and
inlined macros at some later date.
Finally, I noticed a new declaration of
tree_ssa_useless_type_conversion in tree.h. Given that users of
STRIP_USELESS_TYPE_CONVERSION had to include tree-flow.h to see
the declaration, I think it would be preferable to move
Moving STRIP_USELESS_TYPE_CONVERSION from tree.h and into to
tree-flow-inline.h, included by tree-flow.h, seems like the best course
here, so that's what I've done. This eliminates the duplicated
Retesting now... guess I'll be mailing a revised version of the patch on
Again, thanks for the comments.