[PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node
Ken Matsui
kmatsui@cs.washington.edu
Mon Oct 23 21:08:22 GMT 2023
On Mon, Oct 23, 2023 at 1:27 PM Jason Merrill <jason@redhat.com> wrote:
>
> On 10/20/23 09:53, Ken Matsui wrote:
> > Since RID_MAX soon reaches 255 and all built-in traits are used approximately
> > once in a C++ translation unit, this patch removes all RID values for built-in
>
> These two lines are too long; please wrap at 75 columns so they don't go
> over 80 when git log adds 4 spaces at the beginning.
>
> > traits and uses the identifier node to look up the specific trait. Rather
> > than holding traits as keywords, we set all trait identifiers as cik_trait,
> > which is a new cp_identifier_kind. As cik_reserved_for_udlit was unused and
> > cp_identifier_kind is 3 bits, we replaced the unused field with the new
> > cik_trait. Also, the later patch handles a subsequent token to the built-in
> > identifier so that we accept the use of non-function-like built-in trait
> > identifiers.
> >
> > /* True if this identifier is for any operator name (including
> > - conversions). Value 4, 5, 6 or 7. */
> > + conversions). Value 4, 5, or 6. */
> > #define IDENTIFIER_ANY_OP_P(NODE) \
> > - (IDENTIFIER_KIND_BIT_2 (NODE))
> > + (IDENTIFIER_KIND_BIT_2 (NODE) && !IDENTIFIER_TRAIT_P (NODE))
> ...
> > +/* True if this identifier is the name of a built-in trait. */
> > +#define IDENTIFIER_TRAIT_P(NODE) \
> > + (IDENTIFIER_KIND_BIT_0 (NODE) \
> > + && IDENTIFIER_KIND_BIT_1 (NODE) \
> > + && IDENTIFIER_KIND_BIT_2 (NODE))
>
> The other macros use &, not &&; we might as well stay consistent with
> that pattern.
>
Thank you! Will fix these.
> Jason
>
More information about the Libstdc++
mailing list