diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-10-17 16:51:05 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-02-21 12:36:38 +0100 |
commit | 870dd9d5d3c5180efb147f93ed6ae454605c9037 (patch) | |
tree | de7e47f3cf7cfb997a89bb50947658ca4389c53c /gcc/rust/ast/rust-expr.h | |
parent | ed75e142a7082b2f4f0a50a39939566c53b5697b (diff) | |
download | gcc-870dd9d5d3c5180efb147f93ed6ae454605c9037.zip gcc-870dd9d5d3c5180efb147f93ed6ae454605c9037.tar.gz gcc-870dd9d5d3c5180efb147f93ed6ae454605c9037.tar.bz2 |
gccrs: Refactor expression hir lowering into cc file
gcc/rust/ChangeLog:
* Make-lang.in: Add new object file for expression lowering.
* ast/rust-expr.h: Move implementation of expr lowering to source file.
* backend/rust-compile-block.h: Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
* backend/rust-compile-expr.h: Likewise.
* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
* checks/errors/privacy/rust-privacy-reporter.h: Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-const-checker.h: Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
* checks/errors/rust-unsafe-checker.h: Likewise.
* hir/rust-ast-lower-base.h: Likewise.
* hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise.
* hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise.
* hir/rust-hir-dump.cc (Dump::visit): Likewise.
* hir/rust-hir-dump.h: Likewise.
* hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise.
(class ClosureExprInner): Likewise.
(class ClosureExprInnerTyped): Likewise.
* hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise.
(class ClosureExprInnerTyped): Likewise.
* hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise.
(ClosureExprInner::as_string): Likewise.
(ClosureExprInner::accept_vis): Likewise.
(ClosureExpr::accept_vis): Likewise.
(ClosureExprInnerTyped::accept_vis): Likewise.
* hir/tree/rust-hir-visitor.h: Likewise.
* hir/tree/rust-hir.h (class Expr): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
* typecheck/rust-hir-type-check-expr.h: Likewise.
* hir/rust-ast-lower-expr.cc: New file.
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index c764f9c..c58fae5 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -2134,8 +2134,6 @@ struct ClosureParam private: std::vector<Attribute> outer_attrs; std::unique_ptr<Pattern> pattern; - - // bool has_type_given; std::unique_ptr<Type> type; Location locus; @@ -2202,19 +2200,19 @@ public: const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; } std::vector<Attribute> &get_outer_attrs () { return outer_attrs; } - // TODO: is this better? Or is a "vis_block" better? std::unique_ptr<Pattern> &get_pattern () { rust_assert (pattern != nullptr); return pattern; } - // TODO: is this better? Or is a "vis_block" better? std::unique_ptr<Type> &get_type () { rust_assert (has_type_given ()); return type; } + + Location get_locus () const { return locus; } }; // Base closure definition expression AST node - abstract @@ -2248,6 +2246,8 @@ public: { outer_attrs = std::move (new_attrs); } + + bool get_has_move () const { return has_move; } }; // Represents a non-type-specified closure expression AST node @@ -2307,7 +2307,6 @@ public: return closure_inner == nullptr; } - // TODO: is this better? Or is a "vis_block" better? std::unique_ptr<Expr> &get_definition_expr () { rust_assert (closure_inner != nullptr); |