From: Sergey Bugaev Date: Mon, 3 Apr 2023 15:48:45 +0000 (+0300) Subject: gccrs: ast: Add AST::Kind::IDENTIFIER X-Git-Tag: basepoints/gcc-15~2660 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b503080cd219b8f05184f6322d943d1c03f56b08;p=thirdparty%2Fgcc.git gccrs: ast: Add AST::Kind::IDENTIFIER ...and return it from IdentifierExpr::get_ast_kind (). This enables other code to dynamically test whether an expression is in fact an IdentifierExpr. gcc/rust/ChangeLog: * ast/rust-ast.h: Add AST::Kind::IDENTIFIER Signed-off-by: Sergey Bugaev --- diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 3aed56aa7b68..921832ea5010 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -44,6 +44,7 @@ enum class Kind UNKNOWN, MACRO_RULES_DEFINITION, MACRO_INVOCATION, + IDENTIFIER, }; class Visitable @@ -1072,6 +1073,8 @@ public: outer_attrs = std::move (new_attrs); } + Kind get_ast_kind () const override { return Kind::IDENTIFIER; } + protected: // Clone method implementation IdentifierExpr *clone_expr_without_block_impl () const final override