diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-04-26 09:25:35 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:34:16 +0100 |
commit | 35a4c25ae45adc7439327c8981e63f824c88fa5c (patch) | |
tree | f9b74b24c16d37208e508d17a6110772712399a4 /gcc/rust | |
parent | b911f7b85abd3bb96f35d1bd8075a07fd732c71a (diff) | |
download | gcc-35a4c25ae45adc7439327c8981e63f824c88fa5c.zip gcc-35a4c25ae45adc7439327c8981e63f824c88fa5c.tar.gz gcc-35a4c25ae45adc7439327c8981e63f824c88fa5c.tar.bz2 |
gccrs: Add is_expr method to AST::Stmt
gcc/rust/ChangeLog:
* ast/rust-ast.h
(Stmt::is_expr): New.
* ast/rust-stmt.h
(ExprStmt::is_expr): New.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 2 | ||||
-rw-r--r-- | gcc/rust/ast/rust-stmt.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 921832e..70d4d3d 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -901,6 +901,8 @@ public: virtual bool is_item () const = 0; + virtual bool is_expr () const { return false; } + protected: Stmt () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {} diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h index 1b33e1a..59db2a8 100644 --- a/gcc/rust/ast/rust-stmt.h +++ b/gcc/rust/ast/rust-stmt.h @@ -198,6 +198,8 @@ public: bool is_item () const override final { return false; } + bool is_expr () const override final { return true; } + virtual ExprStmtType get_type () const = 0; protected: |