aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-03 18:48:45 +0300
committerCohenArthur <arthur.cohen@embecosm.com>2023-04-17 08:46:19 +0000
commitbfd8e24c2ad0034d2ad0ca59d680d0f9c1250691 (patch)
tree9e02bb426e64e7bae3bebb6b670eaeb6521960d1 /gcc
parent8129f20c818a5519491d7291a5e236bcb98845df (diff)
downloadgcc-bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691.zip
gcc-bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691.tar.gz
gcc-bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691.tar.bz2
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 <bugaevc@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index ee3c89a..a4db7c7 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