This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: use identifier_p instead of naked TREE_CODE == IDENTIFIER_NODE
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Gabriel Dos Reis <gdr at axiomatics dot org>, gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Fri, 22 Mar 2013 10:30:08 +0100
- Subject: Re: C++ PATCH: use identifier_p instead of naked TREE_CODE == IDENTIFIER_NODE
- References: <87vc8kjdou dot fsf at euclid dot axiomatics dot org> <CAFiYyc2R406UDN=v93Dr76f8GkpvVG_boCi=ryU2QS07+Uz2BQ at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 22, 2013 at 10:21:05AM +0100, Richard Biener wrote:
> On Fri, Mar 22, 2013 at 4:50 AM, Gabriel Dos Reis <gdr@axiomatics.org> wrote:
> >
> > This patch introduces identified_p (t) in lieu of
> >
> > TREE_CODE (t) == IDENTIFIER_NODE
>
> Generally we have macros like IDENTIFIER_P for this kind of checks.
>
> > in the C++ front-end. identifier_p is effectively LANG_IDENTIFIER_CAST
> > except that it returns a typed pointer instead of a boolean value.
>
> Hm? So you are replacing TREE_CODE (t) == IDENTIFIER_NODE
> with kind-of dynamic_cast<identifier> (t) (in C++ terms)? Then
> naming it identifier_p is bad. We have is-a.h now, so please try to use
> a single style of C++-style casting throughout GCC.
Anyway, if you see better code generated with your change compared to the
old style, I'd say you should file a PR with some preferrably short
preprocessed routine where it makes a difference, because that would show
that either VRP or other optimization pass just isn't doing good job.
It is better code for --enable-checking=yes anyway, right?
Jakub