Message ID | 20230221120230.596966-7-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 s9csp1825857wrn; Tue, 21 Feb 2023 04:10:04 -0800 (PST) X-Google-Smtp-Source: AK7set9wEeNcvBlz0NCFLbXO4IR3NVD19/0AuiI/jMn+2OpDWX8UMX9ay4U6pxsOOm6UziDheth9 X-Received: by 2002:a05:6402:3216:b0:4a3:43c1:8430 with SMTP id g22-20020a056402321600b004a343c18430mr5040083eda.4.1676981404164; Tue, 21 Feb 2023 04:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676981404; cv=none; d=google.com; s=arc-20160816; b=p0IIGkPs5CVrqh4Uh4S1ML8M6RuZdqMp/QWMvKaaBT6+VeTONP+fLM1mJNM0vcw2fI L5V244nBOANtS05fhjImxd8DxaEZsH6ivNesxaRnrCore43RDl/5EDrYi490ibzZk+iA ylkmvLJmURXOvB2nnTJe7rmVsrCGibP124CAtNvIkDVsdzJm9qckOF7ZfG4RLbPuLAxn GvHN9baDrzA3jF/4bS8TJ8o7Y5fh8s9wj+rBDWQYDk8sAo42Z6z525/zKWp8xB5jsZmr gZQk7wVS/kaothgZ5sYac5J4cecFH/UNCVNhPKqPEuoCbUgcJILFh6cwm1HteJdDpEBT ZfAQ== 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=wVtykWZX9lkBNauDFT/JMu19+rzQAZ+3UNWK/c5HQGc=; b=g2qCZ17gfz2Fyxpj+0pLAKmFe4+mgK8nFjKBeMEMkS1yNWVJPX4aAsPi5G/go7NlAD 8kfuQ0inl+0HttaHHPeHKdVJTlxjEAjx9u0z1e8qnm9Hazcgm/1WlBBAEeJMkCezPFyp xAPUp3G6lCl2aci13Tm/hE3mFSEMm2VU9CaKWVHV7bP3jYFR4/YBYuDhG9oRoEbcff8B fbD8a+oL4QT4FzmowuvL0rfz481tC9pxhPH3/X86VvrpMH5RnwAs9hVqBe4KqNWn0fT0 RRv7VQNvpK+3nOEQzSu6oM6EEWsm8E6rPwii0epf1rUV0XWv1EdIGt7AQVn/tz5dWjeB iKCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=ROVjL1Bv; 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 v15-20020a17090651cf00b008c607dd7ce8si11743743ejk.842.2023.02.21.04.10.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:10: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=ROVjL1Bv; 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 7C58B3850401 for <ouuuleilei@gmail.com>; Tue, 21 Feb 2023 12:05:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id B746C384FB69 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 12:03:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B746C384FB69 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-x42f.google.com with SMTP id p8so4289201wrt.12 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 04:03:30 -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=wVtykWZX9lkBNauDFT/JMu19+rzQAZ+3UNWK/c5HQGc=; b=ROVjL1Bv0RgSguGHReRqtzsB/Uug5P4AR4lJpQOT1kV/zffLVkjwHWUxi+zDCCZrWG UIRGhuZhNWUiXgzdv4/6SzoJ5sOpUSO/IQU8UT93QNgvYyybevIMyHi0uwpurP73+oll L8CWKqdJ+j37RbHwmePS+n1vmB6NLgvq3gwiL5aWGrAUZa6vqRQAeNJXNkDnP3YUlQmx Uo8TWbPX97Y00iQJ5sAiM4qJVqvlY8Jy0/N29SRldAhtaiV8sjRc6FHozyEtTn1Mb3WP A5KgTKiAiwtG1wdCispqdrWfzGn+DB9iz/BaItcTkLH9BglHv7QrJ5oCzYtJ4DeAj4hk wa9Q== 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=wVtykWZX9lkBNauDFT/JMu19+rzQAZ+3UNWK/c5HQGc=; b=Ra60s0aBzXUPAjkFhFKHvt5aQhE1DWVp+8vush/vriM3/XILKYC2p71OKxsTfHNW60 WJRzRl5iL4mJgxPw6e00cB9/4gJP+jWA+Z687RMDZ9SzXzvgEdAbSY5nB8hn69RmVIxi sW6x0BiPz9YRbAGaz0UZBjPvZpHFgDtkgy3ajX3lCMlxE+2GvXrGGoQcjFgfrKqtv1zi gFU8Fvet6rbrNvzpoR+bwKvtRdxbyk56Y0B8NWqpd2m/YqJUnZQhQ8BfcmoDRLRhuJNQ vLSrlLCuDnp01wB9oeZ3Zm8/ki9zSvrXCojjNpX3/SjuwKNv3CXKs4ijMpbGEEqBZiQX WLVw== X-Gm-Message-State: AO0yUKVFAzhrFyiYl/yHcOfPC5vbXcTzBCrW9DjQ8ovjBPt/qTkS+6hC VgG093m5pPe5FzWOpr3/t+bMUcWsxgcUdSJs5Q== X-Received: by 2002:a5d:6f15:0:b0:2c5:51a5:9ef8 with SMTP id ay21-20020a5d6f15000000b002c551a59ef8mr2758553wrb.8.1676981009337; Tue, 21 Feb 2023 04:03:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:03:28 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, David Faust <david.faust@oracle.com> Subject: [committed 006/103] gccrs: ast: dump assignment and compound assignment expr Date: Tue, 21 Feb 2023 13:00:56 +0100 Message-Id: <20230221120230.596966-7-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=ham 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?1758442452745053155?= X-GMAIL-MSGID: =?utf-8?q?1758442452745053155?= |
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, noon UTC
From: David Faust <david.faust@oracle.com>
gcc/rust/ChangeLog:
* ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound
assignment expressions.
---
gcc/rust/ast/rust-ast-dump.cc | 56 +++++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 3d1b42d70e3..f3d0e2d9974 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -306,11 +306,63 @@ Dump::visit (TypeCastExpr &expr) void Dump::visit (AssignmentExpr &expr) -{} +{ + expr.visit_lhs (*this); + stream << " = "; + expr.visit_rhs (*this); +} void Dump::visit (CompoundAssignmentExpr &expr) -{} +{ + auto op = ""; + switch (expr.get_expr_type ()) + { + case CompoundAssignmentOperator::ADD: + op = "+"; + break; + + case CompoundAssignmentOperator::SUBTRACT: + op = "-"; + break; + + case CompoundAssignmentOperator::MULTIPLY: + op = "*"; + break; + + case CompoundAssignmentOperator::DIVIDE: + op = "/"; + break; + + case CompoundAssignmentOperator::MODULUS: + op = "%"; + break; + + case CompoundAssignmentOperator::BITWISE_AND: + op = "&"; + break; + + case CompoundAssignmentOperator::BITWISE_OR: + op = "|"; + break; + + case CompoundAssignmentOperator::BITWISE_XOR: + op = "^"; + break; + + case CompoundAssignmentOperator::LEFT_SHIFT: + op = "<<"; + break; + + case CompoundAssignmentOperator::RIGHT_SHIFT: + op = ">>"; + break; + } + + expr.get_left_expr ()->accept_vis (*this); + stream << " " << op << "= "; + expr.get_right_expr ()->accept_vis (*this); +} void Dump::visit (GroupedExpr &expr)