This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH: Use VAR_P instead of direct TREE_CODE (t) == VAR_DECL
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Gabriel Dos Reis <gdr at axiomatics dot org>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Apr 2013 04:50:46 -0500
- Subject: Re: C++ PATCH: Use VAR_P instead of direct TREE_CODE (t) == VAR_DECL
- References: <87mwtmkxil dot fsf at euclid dot axiomatics dot org> <5155C755 dot 1000107 at oracle dot com> <87a9pmw34o dot fsf at euclid dot axiomatics dot org> <CAFiYyc1vncpO-Ji-7VmLrvQGi5ws+eo+3xz2946moR=-gWTA_Q at mail dot gmail dot com> <CAAiZkiCHHato=QyjwFn9zVFKLrCdgFb7=04cF68WFP4SPM8okw at mail dot gmail dot com> <515AA87E dot 3050603 at oracle dot com>
On Tue, Apr 2, 2013 at 4:44 AM, Paolo Carlini <email@example.com> wrote:
> On 04/02/2013 11:30 AM, Gabriel Dos Reis wrote:
>> Sorry for chiming in late - but VAR_P loses the fact that we are checking
>> for a decl ... VAR_DECL_P would be more like following existing practice
>> (otherwise we can shorten VAR_OR_FUNCTION_DECL_P to
>> VAR_OR_FUNCTION_P for example). As for further cleanups we seem
>> to have a few IS_... macros as well (one even IS_..._P).
>> If we are checking for a VAR, we necessarily checking for a VAR decl..
>> The purpose of the macro is make the predicates more readable.
>> I would not mind having VAR_OR_FUNCTION_P instead.
>> Yes, we should get rid of the IS_.
> For example we have:
> #define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
> shall we keep only one? The below - untested - gets rid of the latter and
> renames the former to OVERLOAD_TYPE_P.
That is a sensible choice. OK, it passes testing.