diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-09-17 15:08:42 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:37 +0100 |
commit | 95703bb75efc3ca0300b78ab9d3f4d544faad4b6 (patch) | |
tree | 480bedb9746410f64d48c4f81550c82b758d0fa4 /gcc/rust/hir/tree/rust-hir-expr.h | |
parent | 0a99bfe15af01e15c07bb5003b54d351f64a5cde (diff) | |
download | gcc-95703bb75efc3ca0300b78ab9d3f4d544faad4b6.zip gcc-95703bb75efc3ca0300b78ab9d3f4d544faad4b6.tar.gz gcc-95703bb75efc3ca0300b78ab9d3f4d544faad4b6.tar.bz2 |
gccrs: Remove HIR::ForLoopExpr
This will end up getting desugared into a LoopExpr with a MatchExpr body.
gcc/rust/ChangeLog:
* backend/rust-compile-block.h: remove HIR::ForLoopExpr
* 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
* checks/lints/rust-lint-marklive.h: likewise
* hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): likewise
* hir/rust-hir-dump.cc (Dump::visit): likewise
* hir/rust-hir-dump.h: likewise
* hir/tree/rust-hir-expr.h (class ForLoopExpr): likewise
* hir/tree/rust-hir-full-decls.h (class ForLoopExpr): likewise
* hir/tree/rust-hir-visitor.h: likewise
* hir/tree/rust-hir.cc (ForLoopExpr::as_string): likewise
(ForLoopExpr::accept_vis): likewise
* typecheck/rust-hir-type-check-expr.h: likewise
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-expr.h')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-expr.h | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h index f0e9a36..3bfadbf 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.h +++ b/gcc/rust/hir/tree/rust-hir-expr.h @@ -3092,73 +3092,6 @@ protected: } }; -// For loop expression HIR node (iterator loop) -class ForLoopExpr : public BaseLoopExpr -{ - std::unique_ptr<Pattern> pattern; - std::unique_ptr<Expr> iterator_expr; - -public: - std::string as_string () const override; - - // Constructor with loop label - ForLoopExpr (Analysis::NodeMapping mappings, - std::unique_ptr<Pattern> loop_pattern, - std::unique_ptr<Expr> iterator_expr, - std::unique_ptr<BlockExpr> loop_body, location_t locus, - LoopLabel loop_label, - AST::AttrVec outer_attribs = AST::AttrVec ()) - : BaseLoopExpr (std::move (mappings), std::move (loop_body), locus, - std::move (loop_label), std::move (outer_attribs)), - pattern (std::move (loop_pattern)), - iterator_expr (std::move (iterator_expr)) - {} - - // Copy constructor with clone - ForLoopExpr (ForLoopExpr const &other) - : BaseLoopExpr (other), pattern (other.pattern->clone_pattern ()), - iterator_expr (other.iterator_expr->clone_expr ()) - {} - - // Overloaded assignment operator to clone - ForLoopExpr &operator= (ForLoopExpr const &other) - { - BaseLoopExpr::operator= (other); - pattern = other.pattern->clone_pattern (); - iterator_expr = other.iterator_expr->clone_expr (); - /*loop_block = other.loop_block->clone_block_expr(); - loop_label = other.loop_label; - outer_attrs = other.outer_attrs;*/ - - return *this; - } - - // move constructors - ForLoopExpr (ForLoopExpr &&other) = default; - ForLoopExpr &operator= (ForLoopExpr &&other) = default; - - void accept_vis (HIRFullVisitor &vis) override; - void accept_vis (HIRExpressionVisitor &vis) override; - - std::unique_ptr<Expr> &get_iterator_expr () { return iterator_expr; } - std::unique_ptr<Pattern> &get_pattern () { return pattern; }; - -protected: - /* Use covariance to implement clone function as returning this object rather - * than base */ - ForLoopExpr *clone_expr_impl () const override - { - return new ForLoopExpr (*this); - } - - /* Use covariance to implement clone function as returning this object rather - * than base */ - ForLoopExpr *clone_expr_with_block_impl () const override - { - return new ForLoopExpr (*this); - } -}; - // forward decl for IfExpr class IfLetExpr; |