C++ PATCH: use identifier_p instead of naked TREE_CODE == IDENTIFIER_NODE

Jakub Jelinek jakub@redhat.com
Fri Mar 22 09:31:00 GMT 2013


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



More information about the Gcc-patches mailing list