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 866D23839183 for ; Fri, 3 Jun 2022 07:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 866D23839183 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-638-TUmbW3gfOeCnIRRTVybo2A-1; Fri, 03 Jun 2022 03:32:27 -0400 X-MC-Unique: TUmbW3gfOeCnIRRTVybo2A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BEE14858EED for ; Fri, 3 Jun 2022 07:32:26 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D2551121319; Fri, 3 Jun 2022 07:32:25 +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 2537WNNt2683120 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 3 Jun 2022 09:32:23 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2537WNqw2683119; Fri, 3 Jun 2022 09:32:23 +0200 From: Aldy Hernandez To: GCC patches Subject: [COMMITTED] Remove unneeded vrange_traits. Date: Fri, 3 Jun 2022 09:32:18 +0200 Message-Id: <20220603073219.2683070-2-aldyh@redhat.com> In-Reply-To: <20220603073219.2683070-1-aldyh@redhat.com> References: <20220603073219.2683070-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.6 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, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Fri, 03 Jun 2022 07:32:29 -0000 The traits struct is no longer needed. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.h (struct vrange_traits): Remove. (is_a): Rewrite without vrange_traits. (as_a): Same. --- gcc/value-range.h | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index 61e6a1887d5..26e41ed2982 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -245,24 +245,12 @@ public: virtual void dump (FILE *) const override; }; -// Traits to implement vrange is_a<> and as_a<>. - -template -struct vrange_traits -{ - // Default to something unusable. - typedef void range_type; -}; - -template<> -struct vrange_traits -{ - typedef irange range_type; -}; +// is_a<> and as_a<> implementation for vrange. +// Anything we haven't specialized is a hard fail. template inline bool -is_a (vrange &v) +is_a (vrange &) { gcc_unreachable (); return false; @@ -281,18 +269,16 @@ template inline T & as_a (vrange &v) { - typedef typename vrange_traits::range_type range_type; - gcc_checking_assert (is_a (v)); - return static_cast (v); + gcc_checking_assert (is_a (v)); + return static_cast (v); } template inline const T & as_a (const vrange &v) { - typedef typename vrange_traits::range_type range_type; - gcc_checking_assert (is_a (v)); - return static_cast (v); + gcc_checking_assert (is_a (v)); + return static_cast (v); } // Specializations for the different range types. -- 2.36.1