From patchwork Wed Apr 5 14:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 79670 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp347316vqo; Wed, 5 Apr 2023 07:24:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJbJ+Nhk+onz/uodBegBN3Ao/TJPpV5wCd08UOOjwMospdnjLR260abVWKXS+j9KyzhlpQ X-Received: by 2002:a17:906:280a:b0:8aa:33c4:87d5 with SMTP id r10-20020a170906280a00b008aa33c487d5mr2808364ejc.10.1680704666672; Wed, 05 Apr 2023 07:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680704666; cv=none; d=google.com; s=arc-20160816; b=0H5uci0k4SPHsUqW/G/pW6AQGphhTe7CQ9T8X3Ybk8VZf6PROmGPHNdUFjpbPijGI1 Suj9+E1K9wlZJSnPWDlCXDeVXFHdvDGUTimSvYu6VZxmhLEC1te1LmQ+5zGpNB6kx3xC hrBbUTqBXBDvwpnphE9tUmZBmf56ZohvojFwCzDwFrFUANGWWiH1sUweUelCMFE58Mus E1xjdq1sMTAgj8MnndlUqK5LF0h5vU/924IyZD5gdPrdGE8gKF+05PvhtzgJKn1zGAiT 07guNTFvdI+Iz22CrxE+9dnV5apG5GWRqhNZMusXEIssNaeOw/r8QOyLJmGjoV3IjpBi k1cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to: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:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=0KlPUlrXdqre4uyKtTF0IFsFUnw78mID3C6zmKeCKjA=; b=wiMHmoVow0YKNRt68/m1XxXJfy0LuGt7Lxwcbjz/th+1CtMO13pTQlNWi90vLK5C7M Fhkku0M50N7c6e9ER/IIYw/FCajt2nty9o2WMTYXvBxMQcguqFCn1nqH1OGLsbjNXY78 ZbFTdHRYPYtIBaTnerIZVgaBTZRcZ2LfPGinsi/x/cNOOtpMxTPbTUl5KA6oEGW5+StM QN2vCOGlCX93L3hkvg08rdtApxPg3JytSwbYo/n7iPNo/WOKS0oFqMx5N/yL49UIfMK6 G/IVfQza5T7qhwSjIxGcwQnPd5Wy4D/fQIdAr16W7KP2Q9FuXRKNOcAt9qi/viuTbCfP JUBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="M5/jf9u6"; 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" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lc7-20020a170906f90700b008cbb481fc84si9632862ejb.20.2023.04.05.07.24.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:24:26 -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=@embecosm.com header.s=google header.b="M5/jf9u6"; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C63E1383024B for ; Wed, 5 Apr 2023 14:11:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 12D0F385703C for ; Wed, 5 Apr 2023 14:05:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12D0F385703C 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-x32e.google.com with SMTP id he13so1340566wmb.2 for ; Wed, 05 Apr 2023 07:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703547; 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=0KlPUlrXdqre4uyKtTF0IFsFUnw78mID3C6zmKeCKjA=; b=M5/jf9u6F+6l5SufZWCmq4hbPYZSpET5aLlui5JoPwJO8eEZKXQ0tfNKfOz0fp81jg /J8gidW+8KOilCXoa5hy4BnSU94GlrlQl1y98wNTvzR2CVFjAXaltfpWvGkIFn0JYEVj hRfh3HDWVtnWzL+xEFhppX81UAFVJLv0n/9rTNfkzm/AqDrKa6mIwKu321Mq0ttzzMmu Soosrox93N+YN1dBE/ajBtJD4ylh0rAhRSd2Wijjk1jfdpg1VxOAEUzxaAiyd/qSRjvl gaToFJCo7D71jEfFNqwAy/2NooUVy4OO+k2Qg2clpkpqlEiN6Oxze0PwUf9ZigTMUErC NaWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703547; 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=0KlPUlrXdqre4uyKtTF0IFsFUnw78mID3C6zmKeCKjA=; b=KlAiqG0IV/UsJ7bYpaykhq7H9+y5cfrOSzNvuu6b8ukf6+mZkce6pdNEURAsAZBkbe GZyJJtpTJmSmhNkh9SPcdT2V3mUEGLO9O50uBhdLp61LLNXrs9Uhg8wkEIkxR/aDQe2v LkEL1wX1Uu8AJju095oD1fCfS710qKMNOU3mKkE7K9A7YYTgshTJqHg5DfEabKDUX6/l 7C/mxvTjvbX76SlczRNLSN9XQPCTnaR9R3ktwtsHdWjKJyECkC/0J6ihJ9OVOSC27973 JQi+ovDMjY/zYKD8rh5wmRarF7I6AoyFkL5+D4MKaU8NnZXwG+4WH0re/zgsyF3EcUhI tjQg== X-Gm-Message-State: AAQBX9e/ikfTh9l67EMgWRXwz2LLJgjSRn2xzr5njks6Vdzspir39+W0 P0geFGU1wiHUrq0Rg02O7mNqTuW5MXXn18pTRA== X-Received: by 2002:a1c:7c11:0:b0:3ee:289a:4382 with SMTP id x17-20020a1c7c11000000b003ee289a4382mr5122772wmc.8.1680703547421; Wed, 05 Apr 2023 07:05:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:05:46 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Owen Avery Subject: [committed 27/88] gccrs: Improve GroupedPattern lowering Date: Wed, 5 Apr 2023 16:03:11 +0200 Message-Id: <20230405140411.3016563-28-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> MIME-Version: 1.0 X-Spam-Status: No, score=-14.6 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 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: , Reply-To: arthur.cohen@embecosm.com 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?1762346576649462532?= X-GMAIL-MSGID: =?utf-8?q?1762346576649462532?= From: Owen Avery gcc/rust/ChangeLog: * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern. Signed-off-by: Owen Avery --- gcc/rust/hir/rust-ast-lower-pattern.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/gcc/rust/hir/rust-ast-lower-pattern.cc b/gcc/rust/hir/rust-ast-lower-pattern.cc index 8ee3a979a33..a0fd8dded38 100644 --- a/gcc/rust/hir/rust-ast-lower-pattern.cc +++ b/gcc/rust/hir/rust-ast-lower-pattern.cc @@ -246,17 +246,7 @@ ASTLoweringPattern::visit (AST::RangePattern &pattern) void ASTLoweringPattern::visit (AST::GroupedPattern &pattern) { - auto crate_num = mappings->get_current_crate (); - Analysis::NodeMapping mapping (crate_num, pattern.get_node_id (), - mappings->get_next_hir_id (crate_num), - UNKNOWN_LOCAL_DEFID); - - HIR::Pattern *inner - = ASTLoweringPattern::translate (pattern.get_pattern_in_parens ().get ()); - - translated - = new HIR::GroupedPattern (mapping, std::unique_ptr (inner), - pattern.get_locus ()); + pattern.get_pattern_in_parens ()->accept_vis (*this); } } // namespace HIR