From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by sourceware.org (Postfix) with ESMTPS id B43963856948 for ; Mon, 23 Oct 2023 21:08:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B43963856948 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B43963856948 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::e2a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698095340; cv=none; b=I/ATO9SYfJEsF9ropQtbvLzEPv0MguNbqbygfiX0GKpF924bODV7LYuUb056F2e15ea4p6wvPq4vpVhMH5aiNz2E9tKB4As9b3tTwyh3ROymDe2QZxw6xzlJsq+NfKVSD+d3XQpqzWhVWdTl/TM8qJiE4qOjrlkIbmwWhpcxct0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698095340; c=relaxed/simple; bh=YQg4S+kOvD9FriaoNPkoroGC7kEYB7BKbx6xtMhCvTk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=IunJMPHe50tgEItKyIvKTZkLG0YjfO2iFNETC1hutyk/buIf4yJ4XcZEIAu4Ew1hR2ImGLe/Vgx9FO/FC0IUR1puFs/3F6ePr3vePeG+ZuhKG/p/t1q//fjUD2StQ1MbD5ihrMiJHigucOA+4MZO7di+K/UT1/zH7IsTGTF9MS8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-457e36dcab6so3219950137.0 for ; Mon, 23 Oct 2023 14:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1698095338; x=1698700138; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y04P5YUSzQkM1VnTD3hyKSDpKqujIFFpLnXA0C27Hcs=; b=XBNmWY7BZmw3ZNHu+vq278Csbt6QOpmrYwqaP8AQy6dIiPJ43yOyPLOHKBp/9juLsO z+bt/HSlJQaDszRroSLAzxalo90jVn4vpMK5ifceR7ZlcYu4lwa2rlpUxevudoxpm2HK g9LcaDQMyjzFJnbQajAasHjuTQbVc0iqvJT2k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698095338; x=1698700138; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y04P5YUSzQkM1VnTD3hyKSDpKqujIFFpLnXA0C27Hcs=; b=cq3fYmPWh8jq//BdTswlUBgGM+5o33XV6GMGeV51g/L5p1hTpw7zVRVWRgvv6EW4O+ 3XTKn0E2MubLP1RPaNr805su1ck7wXhOtfNhW6nqOXZp6Y01BuBMTKK7jl/FvIBSqi38 OypMbLi4R5myGBNHw8hgYnW0b56OpuwD65XHPGdH/p/646N0NXpRJ9rriUQYzbIEz9Ro iYzeY978yR04h2nJKq0o4EwY4iKpFS527mckXzTt6NzrWYzsArpZNHgLdU7dR5kY29l3 EdPWdJtPvbBIcYNxEpwk2OOSccAHtSVT3c0ZcBaVeRvUjqjuEthgt19m5ImqD+3jWwoz CYXQ== X-Gm-Message-State: AOJu0Ywq8SsfU8ci5B4nGVJd/S6W2l/NW/A6MPET2QTgjboRrTktUDs7 UgWzl6X9gtd0Qk2HUjlGgcGcSIYiJKqX0vtUfKMitw== X-Google-Smtp-Source: AGHT+IG6xGhY+d3JXWnXiAg4tQmkJvrzH3553i2eSqzqSDS56WpYFM7f74zA/oPjVeaFVqIr/Nh/9PHrrxV/31tl1lc= X-Received: by 2002:a05:6102:470b:b0:45a:a173:aafb with SMTP id ei11-20020a056102470b00b0045aa173aafbmr167346vsb.12.1698095338031; Mon, 23 Oct 2023 14:08:58 -0700 (PDT) MIME-Version: 1.0 References: <20231017113822.677344-1-kmatsui@gcc.gnu.org> <20231020135748.1846670-1-kmatsui@gcc.gnu.org> <20231020135748.1846670-3-kmatsui@gcc.gnu.org> <601e0316-8b91-48a5-9814-2ebffda1c619@redhat.com> In-Reply-To: <601e0316-8b91-48a5-9814-2ebffda1c619@redhat.com> From: Ken Matsui Date: Mon, 23 Oct 2023 14:08:22 -0700 Message-ID: Subject: Re: [PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node To: Jason Merrill Cc: Ken Matsui , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, Patrick Palka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Oct 23, 2023 at 1:27=E2=80=AFPM Jason Merrill wr= ote: > > On 10/20/23 09:53, Ken Matsui wrote: > > Since RID_MAX soon reaches 255 and all built-in traits are used approxi= mately > > once in a C++ translation unit, this patch removes all RID values for b= uilt-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. Rat= her > > than holding traits as keywords, we set all trait identifiers as cik_tr= ait, > > which is a new cp_identifier_kind. As cik_reserved_for_udlit was unuse= d 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 bui= lt-in > > identifier so that we accept the use of non-function-like built-in trai= t > > 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 >