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: 326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp2149052pxt; Sun, 31 Jul 2022 23:17:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vTu7+EMTbYql/2wcjV8hiKCeouxv/eCVwVJIrtp4mphgcxppW/BMtPscEd8eFxdnX6L0Uf X-Received: by 2002:a17:907:7638:b0:72d:f11b:5ebb with SMTP id jy24-20020a170907763800b0072df11b5ebbmr11563158ejc.647.1659334635514; Sun, 31 Jul 2022 23:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659334635; cv=none; d=google.com; s=arc-20160816; b=L6i/M8CnIQ3mMNdt1U2ptNf7hn+GK2vl3KYUB+rvl8+TprzvXgmqkE5TE+O5ajhebX DaBQaR8+jDKfjYWiv5Ayf7JBo+IjZV/dzJR5SpsckpjKxeIDCSrWPYn/lkU1TeAsCgBV J3nTkulK3ITzEB0ZIz8TEmdY7/pSVZFdLo5Y2Ow1biSHRBBXwvJDNT1VPqNSu2ufMaZh K6Qg+Kjw3KNuxAbH30SLChfkhRYIT22CJg5VhR0UpOQ0qJ2ECqAVX6kwDul0zd5ClHdS Rw05km73STkAOJhzghvxtn+HhUc1+pmbICcLsqdaT6c/6KbdGRUJ8LoXk6ufTTm/+gOn nHiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=e/3YtL4DfYDoCguRkfBZ/sXiGR1XXVn7F/gSEs6GEYI=; b=DRcRx9sTBLzBAq+vymPEg5994VTHZmDFc80YS4riEeWwBOTQn5QXzB8cqgASe13q6Z HfL9x8atbrmw8h8RmNlEYFzEboLG1Lj5kesvO2zMc8ot/4Sv/d0JimNfm604Ppgi8Xkk yY5KLB5PRDYiz9c4WxnYuMYErlpams0Pzh0JkRGWxf/kSVjqAP4EQsbIUMS+bRnC+Xkq DYsKXCkE9I9W23f+1fddo9/aWSnW3ESwthiaHISLl5IECBiy2M3uBrLY1GGMrbdC/6dI 17XR4zDRGNnveX9sQajKOxDHp+xPKnrub8pQ4tiEbpKjeelCVQZemnbED3Kskp9Oblmt 1Nxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mKVXvVRM; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q22-20020a50aa96000000b0043574c5a72fsi9549157edc.360.2022.07.31.23.17.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jul 2022 23:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mKVXvVRM; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F8B3384A8B1 for ; Mon, 1 Aug 2022 06:16:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F8B3384A8B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659334598; 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=mKVXvVRM5GVsqGqG8nTFVsjp/2R00G55atNDQpTSmW/V/PB5GpVMCG515+67SN1om l17OJmmwZ27WcIVjZaB9ACF2gTstnIgodVb31tuMjo3Rum8ddz/U0DrBGEEi9rR3FI g0U9MERKzfgfxw+V4qbMx8IPCGxz63Th1Eof7reI= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1739938474475299375?= X-GMAIL-MSGID: =?utf-8?q?1739938474475299375?= 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); }