From patchwork Mon Aug 1 06:15:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 56458 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F01EC384B0F1 for ; Mon, 1 Aug 2022 06:16:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F01EC384B0F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659334584; bh=e/3YtL4DfYDoCguRkfBZ/sXiGR1XXVn7F/gSEs6GEYI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OJ0GwcEoOg0SZdD2OIFyeUQj0PhAb23ULAleebA6a5glZ3fonApiy/b+E8xCe99x9 0xZYDmA6HnjX2vaHdtPJk6jr7AGejpV5sWbzFnUTxSs9tS9YzRhaCd+Hkw2FwUAFvl HrP2koHpSG6Z5h+SaXuTPO53QE1wNHvQzi4Kfcj0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 163213858412 for ; Mon, 1 Aug 2022 06:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 163213858412 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-Ln-4jPR3NF2qimtBWTUYiA-1; Mon, 01 Aug 2022 02:15:51 -0400 X-MC-Unique: Ln-4jPR3NF2qimtBWTUYiA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 511458037AC for ; Mon, 1 Aug 2022 06:15:51 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.163]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E168D40CFD0A; Mon, 1 Aug 2022 06:15:50 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 2716Fmko229706 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 1 Aug 2022 08:15:48 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2716Fm9k229705; Mon, 1 Aug 2022 08:15:48 +0200 To: GCC patches Subject: [COMMITTED] const_tree conversion of vrange::supports_* Date: Mon, 1 Aug 2022 08:15:39 +0200 Message-Id: <20220801061540.229684-2-aldyh@redhat.com> In-Reply-To: <20220801061540.229684-1-aldyh@redhat.com> References: <20220801061540.229684-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Make all vrange::supports_*_p methods const_tree as they can end up being called from functions that are const_tree. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.cc (vrange::supports_type_p): Use const_tree. (irange::supports_type_p): Same. (frange::supports_type_p): Same. * value-range.h (Value_Range::supports_type_p): Same. (irange::supports_p): Same. --- gcc/value-range.cc | 6 +++--- gcc/value-range.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 2923f4f5a0e..7adbf55c6a6 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -105,7 +105,7 @@ vrange::type () const } bool -vrange::supports_type_p (tree) const +vrange::supports_type_p (const_tree) const { return false; } @@ -229,7 +229,7 @@ vrange::dump (FILE *file) const } bool -irange::supports_type_p (tree type) const +irange::supports_type_p (const_tree type) const { return supports_p (type); } @@ -416,7 +416,7 @@ frange::operator== (const frange &src) const } bool -frange::supports_type_p (tree type) const +frange::supports_type_p (const_tree type) const { return supports_p (type); } diff --git a/gcc/value-range.h b/gcc/value-range.h index e43fbe30f27..c6ab955c407 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -78,7 +78,7 @@ public: virtual void accept (const class vrange_visitor &v) const = 0; virtual void set (tree, tree, value_range_kind = VR_RANGE); virtual tree type () const; - virtual bool supports_type_p (tree type) const; + virtual bool supports_type_p (const_tree type) const; virtual void set_varying (tree type); virtual void set_undefined (); virtual bool union_ (const vrange &); @@ -122,8 +122,8 @@ public: virtual void set_undefined () override; // Range types. - static bool supports_p (tree type); - virtual bool supports_type_p (tree type) const override; + static bool supports_p (const_tree type); + virtual bool supports_type_p (const_tree type) const override; virtual tree type () const override; // Iteration over sub-ranges. @@ -336,7 +336,7 @@ class frange : public vrange public: frange (); frange (const frange &); - static bool supports_p (tree type) + static bool supports_p (const_tree type) { // Disabled until floating point range-ops come live. return 0 && SCALAR_FLOAT_TYPE_P (type); @@ -347,7 +347,7 @@ public: virtual void set_undefined () override; virtual bool union_ (const vrange &) override; virtual bool intersect (const vrange &) override; - virtual bool supports_type_p (tree type) const override; + virtual bool supports_type_p (const_tree type) const override; virtual void accept (const vrange_visitor &v) const override; frange& operator= (const frange &); bool operator== (const frange &) const; @@ -457,7 +457,7 @@ public: operator vrange &(); operator const vrange &() const; void dump (FILE *) const; - static bool supports_type_p (tree type); + static bool supports_type_p (const_tree type); // Convenience methods for vrange compatability. void set (tree min, tree max, value_range_kind kind = VR_RANGE) @@ -588,7 +588,7 @@ Value_Range::operator const vrange &() const // Return TRUE if TYPE is supported by the vrange infrastructure. inline bool -Value_Range::supports_type_p (tree type) +Value_Range::supports_type_p (const_tree type) { return irange::supports_p (type) || frange::supports_p (type); } @@ -730,7 +730,7 @@ irange::nonzero_p () const } inline bool -irange::supports_p (tree type) +irange::supports_p (const_tree type) { return INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type); }