From patchwork Tue Feb 21 12:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 60015 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1836541wrn; Tue, 21 Feb 2023 04:36:16 -0800 (PST) X-Google-Smtp-Source: AK7set/XdytrdVx+LYJF9JQkFifjQw8GjYP8MeQiDBfz5nXEc9p8H4s8wmrZdqH/pzm9uNniZG7V X-Received: by 2002:a17:906:8614:b0:8b1:3304:7767 with SMTP id o20-20020a170906861400b008b133047767mr9481824ejx.67.1676982976463; Tue, 21 Feb 2023 04:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676982976; cv=none; d=google.com; s=arc-20160816; b=ma2+2aGl9SVxtU92nYvHlSm4DP89uR1aLBcI9RoK7k0ISgyb+PQYXO82C8BlKJPUcf g0qop2yBI3MNSv6ePXaiGy9aQQ+t0z8uHYuIlmR6qw5T1s5tT0frGvvoyg9CXoJGBFol 6BKk4MfuxFFe6Fl0F9sZToG+9vFcDGWC4xLLceG6UJgZ7piXlpFV/6X0wPIx975//7Qw uHi04axuxErj1sXqEtRNFm9D/YoI3C9isI0yQfwZl16wUcd9OMJ14CKYNLmCNAOVrKyR 9Fy1ZEsPHjiPwTcBeJ+ZOCM6Ch5QCTUV/qIeht7EXkpzs4EJlWNz9q0C6O8E09ogIBgh wxJQ== 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=zeuPinrsY6MTpPq8oRqtzBS3YcWBmw72rZi2/cH+vmg=; b=JAoDYK/J8eafTSLyw0aVIn/1WI44H2hyqR2p29Iwo3LhbKe0RlcZhtcecAWoI6zxFt UHBR1WJ4eaW03A4o4RDLid2HNcU/oiHKdtgUlua95d7DgSGSHIcBCUyZJUTwP/nYfGj2 K2DzGtaM82LaHYywKtB1wcw/t6rUohpa8vuJQFTOg2UnuVXunJNjBlq1qsxHe+EYvlqX 7WFVFPOgdJCNZcfNS6qVxuVPpdtsOYCE93nUzLOokzv8waY8xbaq+0IxqaLbvSeTpF/4 D1zvcYNlhsX+jvXmhhpLN9qtVWuLNY/AWE9qBG1cJlmEfwn6+3222mAoU48AecszIRV9 Ga1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=Z2ZAmnjF; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fb22-20020a1709073a1600b008d17b125783si7183407ejc.835.2023.02.21.04.36.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:36:16 -0800 (PST) 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=Z2ZAmnjF; 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 30A78383FE26 for ; Tue, 21 Feb 2023 12:12:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 0AEF7383D99B for ; Tue, 21 Feb 2023 12:03:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AEF7383D99B 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-x42c.google.com with SMTP id t15so4267482wrz.7 for ; Tue, 21 Feb 2023 04:03:52 -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=zeuPinrsY6MTpPq8oRqtzBS3YcWBmw72rZi2/cH+vmg=; b=Z2ZAmnjFa1qRtL7XYJ67WOMJoyUxKvWkuJ7mj614iL1UMCegIBsE1nc6Pun2duIHC7 qA8wkNm5DXI+4HWsuNt3i/DS3g2A1QGWWJZ1umdz4jBuEecXnUVQrys8Db+/B+fzZCf4 fX2HQqgMB0ZJaufLIPuMGyuPDN5nJq4u1tr/lrZvqJA4+tOZjLW7VT85Ahi4YMdr4+Te npNJxF7e+Mvx0nBLcqhpJJOiiUIIJCCAYzn2dA/mzNGQM9q3HJV72eYHPH2kXkGB5ZIt heouH87bWDuhmf+0Tn85lTTBI7fVxZugpQrJ+tSNQ4BgWC7gXiteDeSIQOEzZ95nM6uV npFA== 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=zeuPinrsY6MTpPq8oRqtzBS3YcWBmw72rZi2/cH+vmg=; b=66ptoXWGPwqYOBMmJuTTDhoG6xO2mdin5jfLTtqpVIPAzV02fQH28g0RwtLgFabogJ dwkGZEeOcI6YQ8A3usSJAnZhX+n+urX2E/jrcXighK2NYjB7em/39LG69ZGuz1FA6M3/ 2nfb5eCm4YcJkjgxWHw5aWhNY9Ewg7dl2aVWUNB2x50PqYz7WGs1ZEP3GMCXXAGo+JTF +4F0yBasRfXuUBjLyVwt+q8KcVP9Zy/EeTzCj5rNbGrNuJV8gsKVnbFXg5IMo8Jh4S7u /RBKJKTxTq7fYLyVHs2UB+gf89D6OINDZsuzuJ0gIly8XHyvnCjXnUBzem3P5wHadgSU BDAA== X-Gm-Message-State: AO0yUKVDQan2mlPj4+USXpl16ri5uCcmot5u3HLdib+v/DFabJUhk/DN ihc7cebDCEqNeJr1LuC3fvVDBioe3486w9xsNg== X-Received: by 2002:adf:cd8c:0:b0:2c5:4f2d:d9b4 with SMTP id q12-20020adfcd8c000000b002c54f2dd9b4mr3182878wrj.58.1676981031659; Tue, 21 Feb 2023 04:03:51 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:03:51 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [committed 036/103] gccrs: dump: Fix module dumping Date: Tue, 21 Feb 2023 13:01:26 +0100 Message-Id: <20230221120230.596966-37-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=-14.9 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?1758444101325841469?= X-GMAIL-MSGID: =?utf-8?q?1758444101325841469?= From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules. --- gcc/rust/ast/rust-ast-dump.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 653c1d9ff03..1e7a235932d 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -810,11 +810,10 @@ Dump::visit (Method &method) void Dump::visit (Module &module) { - indentation.increment (); - - stream << indentation; emit_visibility (module.get_visibility ()); - stream << "mod" << module.get_name () << " {\n"; + stream << "mod " << module.get_name () << " {\n"; + + indentation.increment (); for (auto &item : module.get_items ()) { @@ -824,6 +823,7 @@ Dump::visit (Module &module) } indentation.decrement (); + stream << indentation << "}\n"; }