From patchwork Tue Feb 21 12:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 60002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1834381wrn; Tue, 21 Feb 2023 04:31:37 -0800 (PST) X-Google-Smtp-Source: AK7set+LrCvOzyd2dnOTBmRXJFLpxUcXbW7KE2FGUi1x76ChDFFLMDuwFoax+DAloBnYLu/Ic5iA X-Received: by 2002:a05:6402:10d9:b0:4ac:bd35:d05b with SMTP id p25-20020a05640210d900b004acbd35d05bmr3922478edu.27.1676982697381; Tue, 21 Feb 2023 04:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676982697; cv=none; d=google.com; s=arc-20160816; b=CBa7lqvVtpsMnN5ak4KC7ucpLz3DpR+UlQVXj79Wo0ODApWAOuxlX1WIf3oQkeCdnv Z0SXVvVNE8CriiAuujJU+cumFKlGsuVJhDdAgQNFdi0FYa5eYUSlfJhDMm5UcXVQ8iTv pxjCHFfuI+pPdv1m727NUfPCKhXg/utTBTJqorHPiNDllxRL9Y/hS/iZFZPtEc3LZABc x7nr6uM+GN/uRWIl0VU9IdKVFoA/nZJ5k6shmfLVrwdFNdiQJzEv0uTGT63QrbdNPRXu kWzgkpuOC43f7LKxSrsQJrstAosVwEa7/UWLlr7Hf3DCCvsPRzb0rG3JsNsP4SPBHBve eavw== 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=9RyVPYw0UdE+p1GAb/kq+6qEzPD+D/YtLlfHnIbSjfM=; b=RVdWH8brRAIFvcQTbIVc2URvzCrzECgaXbu12K+rHKWMyUWaSEXi2eiYQcEc1HpSYO KDiRMh023nFuGoqlWsIiuFKZk9U1uEd+H8MqIzns6lJpLIrcIc3CXTESDCA0IH/aFrsd i35Nxt6Pupkn8vUD67RWen/kMZAIkh3OvOe1hD57p94sCV7pbjhBh5LfHSkjCeO5veDz yiGdhZgkxcNw54ijaXWSyWDVjbgBp1chadLOdzlrJHlUS9q+WMhN359LBzCMBjRapFth q4nnr+WNNkmGDdXMbnOhZzq8FKP7SLR7JEm7Amcb1DiLxME9aMomQNcfhL0fdrq0Udhj 17YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=e6VlhmSF; 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 p18-20020a05640210d200b004acd090f0basi8461509edu.373.2023.02.21.04.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:31:37 -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=e6VlhmSF; 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 D45FF3AA801A for ; Tue, 21 Feb 2023 12:11:45 +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 710CD3844053 for ; Tue, 21 Feb 2023 12:03:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 710CD3844053 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 bo30so3602097wrb.0 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=Yn7+uVGm+x70XPsyigHJdRX2nsN7thB520cg/EyWqEfNXRZdf2f1X9I0hE2l/YZdYQ pdxsw0dwcyzsN5Nc4SvYIhh9KdEQuJ8Imck9nSW0fzSNSPVY+RQvO9GBn7Bn298vG5li vCs8GvZrZ/94bZsXAiPBc/wDIsr/MsJ7p7W8gt0Rxb6ZdVYy4jM8HOeVmbk8eU67kFgu /zQHH0Hi6GUXA9UP9BTfsRdFaqBdVJES1mMwjeKo0W+IlJraegBw+Ue67lw9MW8mvH/u CQ/z7wCtfELl9SDwNSOXoBveLlsFi7K1+31hft/ih70GdbbOzjCcPKhanutOvADSjbkW aaoA== X-Gm-Message-State: AO0yUKUw77X7Szgh0pEDzFXiBlSQaE6QEoMpK0kLaAdO0UeX6ldF2O5O oB5Zdne9vnViyrrV7gXdTf9Un1q2oD0+/cvYiA== 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> MIME-Version: 1.0 X-Spam-Status: No, score=-14.4 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?1758443808713199629?= X-GMAIL-MSGID: =?utf-8?q?1758443808713199629?= 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)