mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 20:01:22 -05:00
gccrs: ast: Add accept_vis() method to GenericArg
gcc/rust/ChangeLog: * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user