From b503080cd219b8f05184f6322d943d1c03f56b08 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 3 Apr 2023 18:48:45 +0300 Subject: [PATCH] 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 --- gcc/rust/ast/rust-ast.h | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.47.2