From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id A8B4D3858439 for ; Wed, 5 Apr 2023 14:05:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A8B4D3858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x336.google.com with SMTP id i5-20020a05600c354500b003edd24054e0so23809905wmq.4 for ; Wed, 05 Apr 2023 07:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703548; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=F/LMRN4J6NtEY2kPr9euv93Xpqb7Yxnuzh469XKJk44=; b=HqlQX7g/lykHQhS0S4Ouv2V7sllgorYoh1oiC7wYqOShJuBv88kfkxM/W839uZ0/LE 5aHojQhTxgZUP3rMlCDfG70ihSKUnZeZDLz7vtyD8VlMF7fdMx1yKAMLYT6K+5r2ELRl ISLLiGnscVtYO2EW8DGkBjBfBRUDTKIKW3aEtnVvOe1DmXsE0rZEdMNJ+SQ3hx5M/ncv 7y/XH26GfHXTJnPQqiUELiDqOA18M2CaTgsae583yhs9ISpPx0WDahgZqsuQxJkQCjoS S1EyKVkfzYTZvIU33TSL44qOgGS2h3GbrOE/LFUp4l3qIstBdunwd7+ROqxeY9M2xpO3 xHYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703548; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=F/LMRN4J6NtEY2kPr9euv93Xpqb7Yxnuzh469XKJk44=; b=3smGcJX4+umpdi2Gf89sAGqGAIvB3uNA3U8Eqln7nszXbCilJu4Y49gzDWsrh9xJPC rGsDinVV1udPK1KE3Vw6TnoFB+kskoabkpg5lZn+JY29hpi3VaQhDp1dgBNvTF0Jdn9c 6PArXWwfk+rZHexipole41BUC1cVFo3xBtWJFe9tNVKml4iufCJLeEE/ZIiVlhzQp8yQ J9rvpOMGViFuS4BfuTd+q70vhcFobxKwKY/3x3RIEAzPc12sAysoYXeNNVIT3zgaDPYU i8yVuXQeGvmaKPO9pXzRO2zgGCCNLTskdCMrseAHXXwxeOgcchtC5hqtTTAxU7KeC5pK knJg== X-Gm-Message-State: AAQBX9c7kgPyr8Wmjb0FUCxiQNAjJ8Dk0uC3pLl3UvmYLZ+6XPS56ZmC LIYQvLpXuIx/3wvVjl8UmEJL X-Google-Smtp-Source: AKy350YIDaiLQ6u/L/OAZkTOxFArlbIPZG26Xsl0P48Z8HvIJKoVl6k5vRvNCx6DUSsbYC59cVphog== X-Received: by 2002:a1c:7904:0:b0:3ef:128d:7167 with SMTP id l4-20020a1c7904000000b003ef128d7167mr5012586wme.13.1680703548471; Wed, 05 Apr 2023 07:05:48 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:05:48 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Owen Avery Subject: [committed 29/88] gccrs: Optimize HIR::ReferencePattern Date: Wed, 5 Apr 2023 16:03:13 +0200 Message-Id: <20230405140411.3016563-30-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405140411.3016563-1-arthur.cohen@embecosm.com> References: <20230405140411.3016563-1-arthur.cohen@embecosm.com> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: From: Owen Avery gcc/rust/ChangeLog: * hir/tree/rust-hir-pattern.h (class ReferencePattern): Remove has_two_amps field. * hir/tree/rust-hir-full-test.cc (ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps. Signed-off-by: Owen Avery --- gcc/rust/hir/tree/rust-hir-full-test.cc | 5 ----- gcc/rust/hir/tree/rust-hir-pattern.h | 13 +++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gcc/rust/hir/tree/rust-hir-full-test.cc b/gcc/rust/hir/tree/rust-hir-full-test.cc index b6646d61b28..0ddb8418e95 100644 --- a/gcc/rust/hir/tree/rust-hir-full-test.cc +++ b/gcc/rust/hir/tree/rust-hir-full-test.cc @@ -2583,11 +2583,6 @@ ReferencePattern::as_string () const { std::string str ("&"); - if (has_two_amps) - { - str += "&"; - } - if (is_mut ()) { str += "mut "; diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h index 5243d7898c0..83b041d2770 100644 --- a/gcc/rust/hir/tree/rust-hir-pattern.h +++ b/gcc/rust/hir/tree/rust-hir-pattern.h @@ -424,7 +424,6 @@ protected: // HIR node for pattern based on dereferencing the pointers given class ReferencePattern : public Pattern { - bool has_two_amps; Mutability mut; std::unique_ptr pattern; Location locus; @@ -435,16 +434,15 @@ public: ReferencePattern (Analysis::NodeMapping mappings, std::unique_ptr pattern, Mutability reference_mut, - bool ref_has_two_amps, Location locus) - : has_two_amps (ref_has_two_amps), mut (reference_mut), - pattern (std::move (pattern)), locus (locus), mappings (mappings) + Location locus) + : mut (reference_mut), pattern (std::move (pattern)), locus (locus), + mappings (mappings) {} // Copy constructor requires clone ReferencePattern (ReferencePattern const &other) - : has_two_amps (other.has_two_amps), mut (other.mut), - pattern (other.pattern->clone_pattern ()), locus (other.locus), - mappings (other.mappings) + : mut (other.mut), pattern (other.pattern->clone_pattern ()), + locus (other.locus), mappings (other.mappings) {} // Overload assignment operator to clone @@ -452,7 +450,6 @@ public: { pattern = other.pattern->clone_pattern (); mut = other.mut; - has_two_amps = other.has_two_amps; locus = other.locus; mappings = other.mappings; -- 2.40.0