Message ID | 20230221120230.596966-38-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1830658wrn; Tue, 21 Feb 2023 04:22:04 -0800 (PST) X-Google-Smtp-Source: AK7set+9KsTViczV96cbovsZJR+Phdxqwvx9y//BGxn6/QsoducfEDHBbcC2pIp2CfPce25PX3pW X-Received: by 2002:a17:906:53da:b0:8b1:fc1a:7d21 with SMTP id p26-20020a17090653da00b008b1fc1a7d21mr14388936ejo.5.1676982124036; Tue, 21 Feb 2023 04:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676982124; cv=none; d=google.com; s=arc-20160816; b=zsumirpbI0i3GtT1fu/CeeKLj0Cff/oTLSlkn9JOmy3kerdgpNtA7zru8Ctz5+3WNB H6EOV1/r6hgD16IzjUxsh4oLyz+K/oXd7PeLfzB/gGu9qbhjUDYbOOcC6uoi42XnuWMC rPje6x5tTFhzEe576uLqTKqCRZ6/iiXWkDhrlxg6tBVbquqx1LrXlgifn6i5GlLPHBGf bgA5X8VSSlQxacDvLHVZ8YYRleNwe/LR3Jo/705C6uSk8CKIBuDNtykr4DZ8gYAOk7lH 9P/fDZnmLpBHVzxNhQ5b9SKo7NoHMNGtKPwpv589KRhxVo9FwUpIOMpkTkVYxD1XXXdk JamA== 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=8pKvx826FvWkNnIXJQaue1CkAv0xBqaasqMXDJHejzk=; b=Bz9qw22B5KYNK7obRDpqq1WsQuAqFjatJpNhRpZftIVjI+FUSssZUDypE5TwQ8KhFi OjXBsbqS3gVNGmJbibmItMoN6AWf+27b3tfhyAzuxVr7Emfwh1u1d8SYzw2l+1QINGQU qgeMuvB2wCceO83rBP71rlJNOMBaHK6NyxusyWzQUiBihOkocRbBTg3J0lEuAMvVHUuI ZgfjGv68L3ZUJsgUKJnARl7dzjDEdqsOwKQimODb2BZ+KCQtTWwF1kXlHsYstsB2cfva le/ADqF+jrVhJ6oK0MkG6nQNgO4CTBo8HISLctLCt4d4EPr1UiSo6XsBQ7qn87eOsV1c ku6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=HII4bawz; 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 30-20020a170906011e00b008b841f2288dsi16442001eje.429.2023.02.21.04.22.03 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:22:04 -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=HII4bawz; 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 CC440380E0EB for <ouuuleilei@gmail.com>; Tue, 21 Feb 2023 12:09:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 226AA3854803 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 12:03:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 226AA3854803 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 r7so3991305wrz.6 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 04:03:53 -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=8pKvx826FvWkNnIXJQaue1CkAv0xBqaasqMXDJHejzk=; b=HII4bawzDnV7OEmOFlkdHMuj6HxJIari1LG6jqaD4QySzUdTX8mWiSR8oZrihggsuz VuE8ekg3PIzQEvBBYf+1kB6aE9ROAd+h3672gI0J6/iyqKtIohnUVqbTEis4SouxqMMz fLKWqC+ZlWpw824H84oEnDaklX54zZe5RYyDthq1WwmqCtx08PM50AYP/QubR7VxJvuq rcoURIQwioKS2vgSHGU8L69dj9kTyKcKPCRsklst21uZZL03Q6kK9Gbo1IsP2i0B9TLf 7kxgoUS0pYoe26BRZX/PmXz/DEIuU1ezPNOYWTaghlqUBSVn+H5VcIHXA46Kwy1c+M7g pqGg== 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=8pKvx826FvWkNnIXJQaue1CkAv0xBqaasqMXDJHejzk=; b=3egxORd/fetLT2TFkNB2r0ABL5lhZlI92psk1W4sbm66VZinJlDGMSAhXyfkbluDwC x5JVLch7CB8+74+P5uoZDdmQa+3/KnibEcUAPw8UlvGCrDVqNpu2G05lb2i28luEGk0P MTHsI1p8jSR3EoWyZlOmm52WMuaAnyGZfH49dHFFh3qogHZ9vgrG0eUSqrkdqEkSNxM0 dY/JTesHwz5td6Qax+7Fa44vNIn0ITRH/Fqa1Uw5RZKnbZ+q4D2NC60hXgeuSbAlRpUr bU1G0fGBt6AYmAvRG08O5MGcjM/57UdqvlULVaFlTcRFLOQoOLjwMQ36zl1sG4bO9MtZ rFbg== X-Gm-Message-State: AO0yUKVo+nGp5fDhX2vPH/aB8LOQwPmF22sUZ1eZ3q0yupphSxXYJfpw mUvZdTclOcjbjb6oJJBeCSUrYhAcdGcmK0T8cg== X-Received: by 2002:a5d:5104:0:b0:2c5:5455:96a1 with SMTP id s4-20020a5d5104000000b002c5545596a1mr5070512wrt.29.1676981032518; Tue, 21 Feb 2023 04:03:52 -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:52 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak <dev@jakubdupak.com> Subject: [committed 037/103] gccrs: ast: Module: unloaded module and inner attributes Date: Tue, 21 Feb 2023 13:01:27 +0100 Message-Id: <20230221120230.596966-38-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 Content-Transfer-Encoding: 8bit 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758443207450330652?= X-GMAIL-MSGID: =?utf-8?q?1758443207450330652?= |
Series |
[committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 21, 2023, 12:01 p.m. UTC
From: Jakub Dupak <dev@jakubdupak.com> gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules. Signed-off-by: Jakub Dupak <dev@jakubdupak.com> --- gcc/rust/ast/rust-ast-dump.cc | 41 +++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-)
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 1e7a235932d..a12c3922c47 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -810,21 +810,44 @@ Dump::visit (Method &method) void Dump::visit (Module &module) { - emit_visibility (module.get_visibility ()); - stream << "mod " << module.get_name () << " {\n"; + // Syntax: + // mod IDENTIFIER ; + // | mod IDENTIFIER { + // InnerAttribute* + // Item* + // } - indentation.increment (); + emit_visibility (module.get_visibility ()); + stream << "mod " << module.get_name (); - for (auto &item : module.get_items ()) + if (module.get_kind () == Module::UNLOADED) { - stream << indentation; - item->accept_vis (*this); - stream << '\n'; + stream << ";\n"; } + else /* Module::LOADED */ + { + stream << " {\n"; - indentation.decrement (); + indentation.increment (); - stream << indentation << "}\n"; + for (auto &item : module.get_inner_attrs ()) + { + stream << indentation; + emit_attrib (item); + stream << '\n'; + } + + for (auto &item : module.get_items ()) + { + stream << indentation; + item->accept_vis (*this); + stream << '\n'; + } + + indentation.decrement (); + + stream << indentation << "}\n"; + } } void