From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 342E4383D986 for ; Tue, 21 Feb 2023 12:03:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 342E4383D986 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-x42e.google.com with SMTP id 6so3757244wrb.11 for ; Tue, 21 Feb 2023 04:03:51 -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=9RyVPYw0UdE+p1GAb/kq+6qEzPD+D/YtLlfHnIbSjfM=; b=e6VlhmSFgbmr9Pph0bEOM+I91XvRYENqKsqyDd77rEiEtpTjkfbFpJTuRmrCRuXgxQ 4/48aQoXSweUVcGCMvCNz9BL/cc9tF5MzullJ5u3e2K0ckMFugjIvuQTr2gmiNBnVepC Gkb0GyioEp6V3F9ZIp+QFzHQ/FTC4jtP9JeiP9UWcVw9twsYBBPD0nzuGG5RzLkHjxV6 anJqAGK4z4OMQOiq+A7udWacMScGdTn8p3FP8+O211gwi1DmGZrZ4JCGX2D9tbOCduYO VZWTsEqnxXmwlEe3wGYp7xg2DKrj8oB3j7fgZz2MsOMr12kovn6b+qC9ON+wEJGe9C+I IRBQ== 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=9RyVPYw0UdE+p1GAb/kq+6qEzPD+D/YtLlfHnIbSjfM=; b=zP6QdpKcBFBE6Ch/z3rNH/KlRAbexlRDeHNcigBzz0bwY/Iunm1vhH/cGqRrJgR+5E mKYphjApjXh5fWt296IWhETq8aZ3Ux+3z33mrBuMLW7IpbXoVMaI+FjVNOfoux3FCJhr ZgjXAsqNv35lIo+5jStH2A7wOto6Epbqkz6keo/E5clvp+Hy4uGMofhTQrOG+SEsgwT8 uONbSdsbYZ+Ae9Ax6WCsVpKXLO0y4RLxuDpUNOeX9/uZMbqHK68nXLT2OMq3eRfPShsb DmXVgtsG/xwPSujOttawcPEM4ncDTTjm+JQ5zb9ooiitrBwTyrrL+pCYs8EGN/u24X2W 75zQ== X-Gm-Message-State: AO0yUKWlDPifJai0LPgWeY9eRsIq/BWwjAMcd1mu8n2c6YXiMxp2R1XD YLCxWLpOg9d4aPf2LCfG27e/ X-Google-Smtp-Source: AK7set+NaWJ6PvybCcNGsESG+US13YDut9Z24c3Q1b5V3u8wYBWjE446ul8SEAy1VUvr3W6/OUBRzw== X-Received: by 2002:adf:f108:0:b0:2c5:561e:809b with SMTP id r8-20020adff108000000b002c5561e809bmr4365668wro.66.1676981030809; Tue, 21 Feb 2023 04:03:50 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:03:50 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [committed 035/103] gccrs: dump: Dump items within modules Date: Tue, 21 Feb 2023 13:01:25 +0100 Message-Id: <20230221120230.596966-36-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> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=ham 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: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly. --- gcc/rust/ast/rust-ast-dump.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index b7557bdee0c..653c1d9ff03 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -809,7 +809,23 @@ Dump::visit (Method &method) void Dump::visit (Module &module) -{} +{ + indentation.increment (); + + stream << indentation; + emit_visibility (module.get_visibility ()); + stream << "mod" << module.get_name () << " {\n"; + + for (auto &item : module.get_items ()) + { + stream << indentation; + item->accept_vis (*this); + stream << '\n'; + } + + indentation.decrement (); + stream << indentation << "}\n"; +} void Dump::visit (ExternCrate &crate) -- 2.39.1