diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-10-01 14:55:15 +0800 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2020-11-28 21:13:21 +0000 |
commit | 2ed062a0be3e2c6e7bd50d25d9ede336fad7be38 (patch) | |
tree | 3eb122d4ae25035a067ddaf78576541a75fdf9b7 /gcc/rust/ast/rust-ast.h | |
parent | 4cfd93746242dc6e73f4fa71520bb361a2d6de4a (diff) | |
download | gcc-2ed062a0be3e2c6e7bd50d25d9ede336fad7be38.zip gcc-2ed062a0be3e2c6e7bd50d25d9ede336fad7be38.tar.gz gcc-2ed062a0be3e2c6e7bd50d25d9ede336fad7be38.tar.bz2 |
Improved parsing of MatchExpr (and AST structure)
Fixed compilation errors
Fixed accidental break out of loop when expr_with_block when parsing match expr
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 4c115b2..f9fbc36 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -2,11 +2,6 @@ #define RUST_AST_BASE_H // Base for AST used in gccrs, basically required by all specific ast things -// GCC imports -#include "config.h" -#include "system.h" -#include "coretypes.h" // order: config, system, coretypes - #include "rust-system.h" // STL imports @@ -847,6 +842,9 @@ public: * methods. */ virtual Location get_locus_slow () const { return Location (); } + // HACK: strictly not needed, but faster than full downcast clone + virtual bool is_expr_without_block () const = 0; + virtual void accept_vis (ASTVisitor &vis) = 0; protected: @@ -887,6 +885,8 @@ protected: return clone_expr_without_block_impl (); } + bool is_expr_without_block () const final override { return true; }; + public: // Unique pointer custom clone function std::unique_ptr<ExprWithoutBlock> clone_expr_without_block () const |