From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 302DD3858412 for ; Mon, 23 Oct 2023 20:27:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 302DD3858412 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 302DD3858412 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698092877; cv=none; b=Hr2v8bjs3vqUvZs0oMUFY1qvzikQs+9anHFZQbzO/l2ZnEFnBTee6yrRcG4WJamdSnwrjBjdLfySG8Da5dN9qyl3fSxjJKXWLuuLLyA88/3qZbgN7iTyqw5xA4wXT144JBjq/3e+OECH2MQ55VHgoJJ48YhnjBiZAYhX0yD5IHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698092877; c=relaxed/simple; bh=tUMEG53hflVJtEBxLLRTbbh0+aFBxT4ZLFaxoW0I9Fc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=joJVSEe0qxRg6MKF8nyxjX0n2698Hlsc8nZWT729xkHvUNLJepz7qol3DfkWflsYFeVlMnALbKOh6UTl2Dh23/ppCThM4EIA7fjb2AhHk/yUwc+C3kdgQHAAZmdbkNk4qYZpmP7b2r4pm4VXFVxGDe9jnexbZuc33H1M6aP4Yos= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698092875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+RW9TMAxzA9gfYL8vo2w7vz9bRqyJaTzDIRGwfEViVk=; b=WRt8+Gf45/kv3yRilkQU7GchcVn1bqa3baIOCyJotoRYglx2VWbzSeS2ZZZiaOG0A3C+Rw LlwzmKM2rgS9RMAiEi+krhNijAgC0+2zwxF5myHdbkOI+2qsZwrNrVnawckriyxMlRyeyd v3ts5l4aqPGjHYzFQgPVmW+KWX4qo/M= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-v_O2dmgBM8OpCx59VyWcnA-1; Mon, 23 Oct 2023 16:27:46 -0400 X-MC-Unique: v_O2dmgBM8OpCx59VyWcnA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-41ce372d248so36074081cf.2 for ; Mon, 23 Oct 2023 13:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698092866; x=1698697666; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+RW9TMAxzA9gfYL8vo2w7vz9bRqyJaTzDIRGwfEViVk=; b=r0O6IPtHcEA5grTfqjp0wzxNSXTMw9Ffx4Kj3Pp9i2NcQqbDcmUJuX/4pCvxs/oF8L GlSJKqtcNij4RtS/d+c+Rk9F/ZGz7C383zFvwR/ryZqxmJsOfLmJJY/uaigXBuAaqFm2 iEnb5HWIxUJV6XQ1CCnNerE+vqFuKsmc1a88BnpTMeMhQBYMZha5xYgIIkDRYCIoMbr5 +tXi1TmtHf/JnqOFaRZtvNWG6wrQ/UvzcSqFydu55WMBT1Ad7y9E0469L2VzdLz7HVj3 +iGxxqinJykQp57Y5E/zviqaOyYNmh+mG5kiQnBETD34DWdch6cq4+KIv18HxoZbSumS 3Tig== X-Gm-Message-State: AOJu0YyAkO0afG/fyidJKuldQLE5M5XA87XZ/YipvROhFCPOXIlpyu/l N0HxbiQzIQ11ToDQ2ytdzDOuCpH0gwe5HFLU0oIqRUX2yHZrV6PxtM9EvA2E9qrFxzTbO0kI4fq vYS8XBZVpa3zC9JI= X-Received: by 2002:ac8:5f49:0:b0:41e:20f4:c07a with SMTP id y9-20020ac85f49000000b0041e20f4c07amr4094528qta.51.1698092866445; Mon, 23 Oct 2023 13:27:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErgFOR91Wyh1uYvBut7GK0fsg0pgkaFxtjrUauFaQit+2RWkHUIxkKzx9Sfm4T5Jf/3bPJaQ== X-Received: by 2002:ac8:5f49:0:b0:41e:20f4:c07a with SMTP id y9-20020ac85f49000000b0041e20f4c07amr4094495qta.51.1698092865967; Mon, 23 Oct 2023 13:27:45 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id fx9-20020a05622a4ac900b0041991642c62sm2994583qtb.73.2023.10.23.13.27.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 13:27:45 -0700 (PDT) Message-ID: <601e0316-8b91-48a5-9814-2ebffda1c619@redhat.com> Date: Mon, 23 Oct 2023 16:27:44 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node To: Ken Matsui , gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka References: <20231017113822.677344-1-kmatsui@gcc.gnu.org> <20231020135748.1846670-1-kmatsui@gcc.gnu.org> <20231020135748.1846670-3-kmatsui@gcc.gnu.org> From: Jason Merrill In-Reply-To: <20231020135748.1846670-3-kmatsui@gcc.gnu.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 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. Jason