From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 6959C385414E; Fri, 14 Oct 2022 15:58:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6959C385414E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665763117; bh=+6BsP6aH6pmWkccfEkc43sCdiE+jCZst1mLVjJ60OfQ=; h=From:To:Subject:Date:From; b=qQJR1fQaRSJCV7G6SZ1O5UWDY6EHwoNw+3GnudxE4ICpCqRZzDKPrCIsmCy1CNdFz rYRhFX8D/FLtOMC7BGEWHOjXKBmBc8B02R6ULAJ18pcGjTS7Az+apYmO26ORp0uIPo WFNkOEZy3EWug3Ed6vvjUgUVZDlrUPWIrZC+d5XI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] ast: Add accept_vis() method to `GenericArg` X-Act-Checkin: gcc X-Git-Author: Arthur Cohen X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 3dc104bc8aaf3edf7aa59b11efacdd9349054df7 X-Git-Newrev: 113f73f368277deeea546f6133f7c85bcccb30f7 Message-Id: <20221014155837.6959C385414E@sourceware.org> Date: Fri, 14 Oct 2022 15:58:37 +0000 (GMT) List-Id: https://gcc.gnu.org/g:113f73f368277deeea546f6133f7c85bcccb30f7 commit 113f73f368277deeea546f6133f7c85bcccb30f7 Author: Arthur Cohen Date: Tue Oct 11 15:54:07 2022 +0200 ast: Add accept_vis() method to `GenericArg` Diff: --- gcc/rust/ast/rust-path.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index cc79e278f05..80ff960db90 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -207,6 +207,23 @@ public: Kind get_kind () const { return kind; } const Location &get_locus () const { return locus; } + void accept_vis (AST::ASTVisitor &visitor) + { + switch (get_kind ()) + { + case Kind::Const: + get_expression ()->accept_vis (visitor); + break; + case Kind::Type: + get_type ()->accept_vis (visitor); + break; + case Kind::Either: + break; + case Kind::Error: + gcc_unreachable (); + } + } + std::unique_ptr &get_expression () { rust_assert (kind == Kind::Const);