From patchwork Fri Jun 3 07:32:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1638617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=TwBxSLIE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LDvk02lpbz9s0w for ; Fri, 3 Jun 2022 17:32:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D2023839198 for ; Fri, 3 Jun 2022 07:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D2023839198 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1654241568; bh=6VyXHsQZXDdFtSciycBUA9dULI5zqCUQoiGGgD8BTAA=; 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=TwBxSLIETdWxXAXJEt/fH/I7aZFqX+bCiq1a0uATvoIEsA7tDBGKxrKyp74jUvgdU 2YTDuD5YOHl1JpL3D6NI6ZmpDl6qgxmanh+ob+sdDxfpK9tE3/jc43uKt6hthbc3Wh h3x7Mm4uPMcb2uxJ+FhEVyeotb9kUc1OLJ53Ny0s= 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 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 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 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-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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.