From 113f73f368277deeea546f6133f7c85bcccb30f7 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 11 Oct 2022 15:54:07 +0200 Subject: ast: Add accept_vis() method to `GenericArg` --- gcc/rust/ast/rust-path.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index cc79e27..80ff960 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); -- cgit v1.1