From patchwork Tue Feb 21 12:01:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 60003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1834484wrn; Tue, 21 Feb 2023 04:31:52 -0800 (PST) X-Google-Smtp-Source: AK7set9ydCv4ditnOmdzW4/fZ+zDFMbh0V1mi8/iHFaC1CU9LsY6HhsW9MdCSG6rpxuqcTMubIea X-Received: by 2002:a17:906:70c5:b0:8b1:3d17:811e with SMTP id g5-20020a17090670c500b008b13d17811emr11041858ejk.12.1676982712707; Tue, 21 Feb 2023 04:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676982712; cv=none; d=google.com; s=arc-20160816; b=b3ZecB9pi6gI2O8HNdIju3LHnCyK6r78KiyhS8NVuQsCbl/N1gFN//NgJIKTh7tTqh ZUIwTPo2sT9wQzL+S+XwMAVordzX2XzZEAyC8eLIZ+DJ37p5VSFNeoUUG204MYhHfTpA chisXjUaJ77PY1CXPDxiNEDeG0BRbTYBckNNGmKEn4o7wpQrSvJkkAn1CGjReS7Ubv3X CGNl/Prpx26wqYIvGgjqHEvT14H5B7fZa2sSsxK6NngnR/Gzt+fOjpuy4T+AB9IScwDc eUHCkp0txdopKU82BS5Ael+3q3x2sWprRLRwbu73tgRWISZRJM6HnfxyZEaL7/d5aVQ+ O/iw== 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=hOqfwE3wkTzoLZ4O/E/DEsRHNpWnm2k7Dz+yLnaoaTY=; b=bVadnmEFTd2mdkW/zbruh5gDOrUDc7C7eEecg31ezDdgU2zwVv1n1wt/o3Y7HrIPE+ d0WVg88evp6rJP1FR9VSwYDr6VksHVuQV/XAheM3LOOQgfG+x3hyQdxtjlpwuGBSmMNR dYwEJUUDs5i188HpzKknXqQvEg8ksOJdRjID/rc8lepnbR5gVy1j+XMby6aUmKuu3mXh 558YTyvTCmxidHo3MjI4eIZg4qaDieC4FktnH2MSj0tnG63S8Ar9CZ6jkZeV75GockZ6 1BA6LCuj/8hJWq8aSxt6wsYQhTBU9XzkMsv0sMEZxGfSgaC7bOndw7xvrSXiZhJoU72N wxPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=DjVRMe+l; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ft31-20020a170907801f00b008e0927211b1si1477517ejc.775.2023.02.21.04.31.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=DjVRMe+l; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 AAA8538D1BA0 for ; Tue, 21 Feb 2023 12:11:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 13F77384FB6B for ; Tue, 21 Feb 2023 12:03:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13F77384FB6B 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-wr1-x42a.google.com with SMTP id t15so4267252wrz.7 for ; Tue, 21 Feb 2023 04:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; 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=hOqfwE3wkTzoLZ4O/E/DEsRHNpWnm2k7Dz+yLnaoaTY=; b=DjVRMe+lFzJRs8PclEZ9svHmnqiWIZZn6WrcOtegwohdKcvxop/uUw/68ynTx9j1MY ge0QmkDpEiIrKCngu4RbHqeGArp4a6KthYsSmdaZ36oFOe/Xa5bjx8Mvz9DD5jFGrOhq rwBOUByhfiXDeJT6M4/em7KHDolkaSU7Mkdhu5ZVms+T/F86SsEzhYl22h1xbYJEm/XJ ITFB/M0/TRRmrTJx5apeaPRJdD9qPh1XLsrDVaX3zWML50ZuQVU92qicyKviObo/Yj5J wXqQv1YGpudneEBFDMvEP2LjT+4mVSIldgO5jhxBA2ot+uirfnUxQQU/yehnD5pJqXIy Djvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hOqfwE3wkTzoLZ4O/E/DEsRHNpWnm2k7Dz+yLnaoaTY=; b=mh3KpaoPr2MHUCimlCso0BpeDbpcLmUdZsTSrnYdYBE/R3BnSrCzGPIdH2tSqer3Y3 1/WLMx9eejaeeUn7i2OQTeAuqoWS/5PHRk+LeGx6gxWSAK36knieD+iCNwVJbARYf35k gdooUPWXWPWDGqi3P4zQ6n87MsZ3p8RFn4awBTCNL4G9/utmlRT9EQkTRp8aaGyww4fz 6pvOvYyn/UEaAhvSTDQsJ9znLbAyNL1VdpQxnDKiOk4nLdG2DfQkupGFM4K6CTbdcXh/ 6bIVfyuAkmNe191scXv2EwCxwxVSsJ+2MQcioSR4cjOAeXmY3TgoL4IZZpq6aFMjJeMD kA6A== X-Gm-Message-State: AO0yUKUTXVCYJ5P6ULzn1jzFnclGS+mKkHxDPq8t9VOKKcguPNL4K3zG Kq8rXCWncUVxWAEpW8vMeFT9ldLueprV1oeA+g== X-Received: by 2002:a5d:5511:0:b0:2c3:e7d8:245c with SMTP id b17-20020a5d5511000000b002c3e7d8245cmr3052626wrv.13.1676981027409; Tue, 21 Feb 2023 04:03:47 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:03:46 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, David Faust Subject: [committed 030/103] gccrs: ast: dump: RangeExprs Date: Tue, 21 Feb 2023 13:01:20 +0100 Message-Id: <20230221120230.596966-31-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-15.0 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?1758443825065627356?= X-GMAIL-MSGID: =?utf-8?q?1758443825065627356?= From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs. --- gcc/rust/ast/rust-ast-dump.cc | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index b9e08b59554..8caad987538 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -622,27 +622,46 @@ Dump::visit (BreakExpr &expr) void Dump::visit (RangeFromToExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << ".."; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeFromExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << ".."; +} void Dump::visit (RangeToExpr &expr) -{} +{ + stream << ".."; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeFullExpr &expr) -{} +{ + stream << ".."; +} void Dump::visit (RangeFromToInclExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << "..="; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeToInclExpr &expr) -{} +{ + stream << "..="; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (ReturnExpr &expr)