]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add is_expr method to AST::Stmt
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 26 Apr 2023 13:25:35 +0000 (09:25 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:16 +0000 (18:34 +0100)
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>
gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-stmt.h

index 921832ea5010c17f2983b665907a2911a14de7a2..70d4d3ddc1c33119888f1cca5091bffdd0429776 100644 (file)
@@ -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 ()) {}
 
index 1b33e1a2e4be6b9ef532293faf3ad05f2bce8236..59db2a8bca2f021904025a4c74c2229c8b513564 100644 (file)
@@ -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: