From: Arthur Cohen Date: Tue, 11 Oct 2022 13:54:07 +0000 (+0200) Subject: gccrs: ast: Add accept_vis() method to `GenericArg` X-Git-Tag: basepoints/gcc-14~1035 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f1035fc91ce1b9dd6e08d47befefff6b2b878db;p=thirdparty%2Fgcc.git gccrs: ast: Add accept_vis() method to `GenericArg` gcc/rust/ChangeLog: * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class. --- diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index b12e4c2bafa9..9683ad6ad68b 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);