diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-11 15:54:07 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-11 15:58:06 +0200 |
commit | 113f73f368277deeea546f6133f7c85bcccb30f7 (patch) | |
tree | b01a213044d5b3a4681cf392200d6837e4b444fe /gcc | |
parent | 3dc104bc8aaf3edf7aa59b11efacdd9349054df7 (diff) | |
download | gcc-113f73f368277deeea546f6133f7c85bcccb30f7.zip gcc-113f73f368277deeea546f6133f7c85bcccb30f7.tar.gz gcc-113f73f368277deeea546f6133f7c85bcccb30f7.tar.bz2 |
ast: Add accept_vis() method to `GenericArg`
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-path.h | 17 |
1 files changed, 17 insertions, 0 deletions
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<Expr> &get_expression () { rust_assert (kind == Kind::Const); |