From: Owen Avery Date: Thu, 16 Mar 2023 03:30:19 +0000 (-0400) Subject: gccrs: Unify AST::IfLetExprConseqIf{,Let} into AST::IfLetExprConseqElse X-Git-Tag: basepoints/gcc-15~2664 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2df348dcd5c7ef51e5a686a4d2473ae9bbb36bb;p=thirdparty%2Fgcc.git gccrs: Unify AST::IfLetExprConseqIf{,Let} into AST::IfLetExprConseqElse This simplifies the AST's representation of if-let-statements to match the HIR. gcc/rust/ChangeLog: * ast/rust-expr.h (class IfLetExprConseqElse): Make else_block ExprWithBlock. (class IfLetExprConseqIf): Remove. (class IfLetExprConseqIfLet): Remove. * ast/rust-ast-full-decls.h (class IfLetExprConseqIf): Remove. (class IfLetExprConseqIfLet): Remove. * ast/rust-ast.cc (IfLetExprConseqElse::as_string): Adjust output. (IfLetExprConseqIf::as_string): Remove. (IfLetExprConseqIfLet::as_string): Remove. (IfLetExprConseqIf::accept_vis): Remove. (IfLetExprConseqIfLet::accept_vis): Remove. * ast/rust-ast-visitor.h (ASTVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors. * ast/rust-ast-dump.cc (Dump::visit): Likewise. * ast/rust-ast-dump.h: (Dump::visit): Likewise. * ast/rust-ast-tokenstream.cc (TokenStream::visit): Likewise. * ast/rust-ast-tokenstream.h (TokenStream::visit): Likewise. * util/rust-attributes.cc (AttributeChecker::visit): Likewise. * util/rust-attributes.h: (AttributeChecker::visit): Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. * resolve/rust-early-name-resolver.h (EarlyNameResolver::visit): Likewise. * resolve/rust-ast-resolve-base.h (ResolverBase::visit): Likewise. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise. * checks/errors/rust-feature-gate.h (FeatureGate::visit): Likewise. * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise. * expand/rust-cfg-strip.h: (CfgStrip::visit): Likewise. * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise. * expand/rust-expand-visitor.h (ExpandVisitor::visit): Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise. * hir/rust-ast-lower-base.h: (ASTLoweringBase::visit): Likewise. * parse/rust-parse-impl.h (Parser::parse_if_let_expr): Replace IfLetExprConseqIf{,Let} with IfLetExprConseqElse. Signed-off-by: Owen Avery --- diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 12cbfacb5d00..ce934a1ed7ae 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -944,14 +944,6 @@ void Dump::visit (IfLetExprConseqElse &) {} -void -Dump::visit (IfLetExprConseqIf &) -{} - -void -Dump::visit (IfLetExprConseqIfLet &) -{} - void Dump::visit (MatchExpr &) {} diff --git a/gcc/rust/ast/rust-ast-dump.h b/gcc/rust/ast/rust-ast-dump.h index a48d4761bb6e..b8b5e960035c 100644 --- a/gcc/rust/ast/rust-ast-dump.h +++ b/gcc/rust/ast/rust-ast-dump.h @@ -186,8 +186,6 @@ private: void visit (IfExprConseqElse &expr); void visit (IfLetExpr &expr); void visit (IfLetExprConseqElse &expr); - void visit (IfLetExprConseqIf &expr); - void visit (IfLetExprConseqIfLet &expr); void visit (MatchExpr &expr); void visit (AwaitExpr &expr); void visit (AsyncBlockExpr &expr); diff --git a/gcc/rust/ast/rust-ast-full-decls.h b/gcc/rust/ast/rust-ast-full-decls.h index 94691f980a6d..bd59c526ddc3 100644 --- a/gcc/rust/ast/rust-ast-full-decls.h +++ b/gcc/rust/ast/rust-ast-full-decls.h @@ -137,8 +137,6 @@ class IfExpr; class IfExprConseqElse; class IfLetExpr; class IfLetExprConseqElse; -class IfLetExprConseqIf; -class IfLetExprConseqIfLet; struct MatchArm; // class MatchCase; // class MatchCaseBlockExpr; diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc index cdfd8701c6de..78b53852658f 100644 --- a/gcc/rust/ast/rust-ast-tokenstream.cc +++ b/gcc/rust/ast/rust-ast-tokenstream.cc @@ -1448,24 +1448,6 @@ TokenStream::visit (IfLetExprConseqElse &expr) visit (expr.get_else_block ()); } -void -TokenStream::visit (IfLetExprConseqIf &expr) -{ - visit (static_cast (expr)); - indentation (); - tokens.push_back (Rust::Token::make (ELSE, expr.get_locus ())); - visit (expr.get_conseq_if_expr ()); -} - -void -TokenStream::visit (IfLetExprConseqIfLet &expr) -{ - visit (static_cast (expr)); - indentation (); - tokens.push_back (Rust::Token::make (ELSE, expr.get_locus ())); - visit (expr.get_conseq_if_let_expr ()); -} - void TokenStream::visit (MatchArm &arm) { diff --git a/gcc/rust/ast/rust-ast-tokenstream.h b/gcc/rust/ast/rust-ast-tokenstream.h index 83fdece70528..24be831009a9 100644 --- a/gcc/rust/ast/rust-ast-tokenstream.h +++ b/gcc/rust/ast/rust-ast-tokenstream.h @@ -200,8 +200,6 @@ private: void visit (IfExprConseqElse &expr); void visit (IfLetExpr &expr); void visit (IfLetExprConseqElse &expr); - void visit (IfLetExprConseqIf &expr); - void visit (IfLetExprConseqIfLet &expr); void visit (MatchArm &arm); void visit (MatchCase &arm); void visit (MatchExpr &expr); diff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h index 621f09ef62b1..f11c9c31ae2d 100644 --- a/gcc/rust/ast/rust-ast-visitor.h +++ b/gcc/rust/ast/rust-ast-visitor.h @@ -117,8 +117,6 @@ public: virtual void visit (IfExprConseqElse &expr) = 0; virtual void visit (IfLetExpr &expr) = 0; virtual void visit (IfLetExprConseqElse &expr) = 0; - virtual void visit (IfLetExprConseqIf &expr) = 0; - virtual void visit (IfLetExprConseqIfLet &expr) = 0; // virtual void visit(MatchCase& match_case) = 0; // virtual void visit (MatchCaseBlockExpr &match_case) = 0; // virtual void visit (MatchCaseExpr &match_case) = 0; diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index dbbeda38a44a..a664a319513a 100644 --- a/gcc/rust/ast/rust-ast.cc +++ b/gcc/rust/ast/rust-ast.cc @@ -1673,27 +1673,7 @@ IfLetExprConseqElse::as_string () const { std::string str = IfLetExpr::as_string (); - str += "\n Else block expr: " + else_block->as_string (); - - return str; -} - -std::string -IfLetExprConseqIf::as_string () const -{ - std::string str = IfLetExpr::as_string (); - - str += "\n Else if expr: \n " + if_expr->as_string (); - - return str; -} - -std::string -IfLetExprConseqIfLet::as_string () const -{ - std::string str = IfLetExpr::as_string (); - - str += "\n Else if let expr: \n " + if_let_expr->as_string (); + str += "\n Else expr: " + else_block->as_string (); return str; } @@ -4567,18 +4547,6 @@ IfLetExprConseqElse::accept_vis (ASTVisitor &vis) vis.visit (*this); } -void -IfLetExprConseqIf::accept_vis (ASTVisitor &vis) -{ - vis.visit (*this); -} - -void -IfLetExprConseqIfLet::accept_vis (ASTVisitor &vis) -{ - vis.visit (*this); -} - void MatchExpr::accept_vis (ASTVisitor &vis) { diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index f91d9e9ceb20..abe6e03ce45b 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -3945,7 +3945,7 @@ protected: * end */ class IfLetExprConseqElse : public IfLetExpr { - std::unique_ptr else_block; + std::unique_ptr else_block; public: std::string as_string () const override; @@ -3953,8 +3953,8 @@ public: IfLetExprConseqElse ( std::vector > match_arm_patterns, std::unique_ptr value, std::unique_ptr if_block, - std::unique_ptr else_block, std::vector outer_attrs, - Location locus) + std::unique_ptr else_block, + std::vector outer_attrs, Location locus) : IfLetExpr (std::move (match_arm_patterns), std::move (value), std::move (if_block), std::move (outer_attrs), locus), else_block (std::move (else_block)) @@ -3963,7 +3963,7 @@ public: // copy constructor with clone IfLetExprConseqElse (IfLetExprConseqElse const &other) - : IfLetExpr (other), else_block (other.else_block->clone_block_expr ()) + : IfLetExpr (other), else_block (other.else_block->clone_expr_with_block ()) {} // overload assignment operator to clone @@ -3973,7 +3973,7 @@ public: // match_arm_patterns = other.match_arm_patterns; // value = other.value->clone_expr(); // if_block = other.if_block->clone_block_expr(); - else_block = other.else_block->clone_block_expr (); + else_block = other.else_block->clone_expr_with_block (); // outer_attrs = other.outer_attrs; return *this; @@ -3986,7 +3986,7 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: is this better? Or is a "vis_block" better? - std::unique_ptr &get_else_block () + std::unique_ptr &get_else_block () { rust_assert (else_block != nullptr); return else_block; @@ -4001,124 +4001,6 @@ protected: } }; -/* AST node representing "if let" expression with an "else if" expression at the - * end */ -class IfLetExprConseqIf : public IfLetExpr -{ - std::unique_ptr if_expr; - -public: - std::string as_string () const override; - - IfLetExprConseqIf (std::vector > match_arm_patterns, - std::unique_ptr value, - std::unique_ptr if_block, - std::unique_ptr if_expr, - std::vector outer_attrs, Location locus) - : IfLetExpr (std::move (match_arm_patterns), std::move (value), - std::move (if_block), std::move (outer_attrs), locus), - if_expr (std::move (if_expr)) - {} - // again, outer attributes not allowed - - // copy constructor with clone - IfLetExprConseqIf (IfLetExprConseqIf const &other) - : IfLetExpr (other), if_expr (other.if_expr->clone_if_expr ()) - {} - - // overload assignment operator to clone - IfLetExprConseqIf &operator= (IfLetExprConseqIf const &other) - { - IfLetExpr::operator= (other); - // match_arm_patterns = other.match_arm_patterns; - // value = other.value->clone_expr(); - // if_block = other.if_block->clone_block_expr(); - if_expr = other.if_expr->clone_if_expr (); - - return *this; - } - - // move constructors - IfLetExprConseqIf (IfLetExprConseqIf &&other) = default; - IfLetExprConseqIf &operator= (IfLetExprConseqIf &&other) = default; - - void accept_vis (ASTVisitor &vis) override; - - // TODO: is this better? Or is a "vis_block" better? - std::unique_ptr &get_conseq_if_expr () - { - rust_assert (if_expr != nullptr); - return if_expr; - } - -protected: - /* Use covariance to implement clone function as returning this object rather - * than base */ - IfLetExprConseqIf *clone_if_let_expr_impl () const override - { - return new IfLetExprConseqIf (*this); - } -}; - -/* AST node representing "if let" expression with an "else if let" expression at - * the end */ -class IfLetExprConseqIfLet : public IfLetExpr -{ - std::unique_ptr if_let_expr; - -public: - std::string as_string () const override; - - IfLetExprConseqIfLet ( - std::vector > match_arm_patterns, - std::unique_ptr value, std::unique_ptr if_block, - std::unique_ptr if_let_expr, std::vector outer_attrs, - Location locus) - : IfLetExpr (std::move (match_arm_patterns), std::move (value), - std::move (if_block), std::move (outer_attrs), locus), - if_let_expr (std::move (if_let_expr)) - {} - // outer attributes not allowed - - // copy constructor with clone - IfLetExprConseqIfLet (IfLetExprConseqIfLet const &other) - : IfLetExpr (other), if_let_expr (other.if_let_expr->clone_if_let_expr ()) - {} - - // overload assignment operator to clone - IfLetExprConseqIfLet &operator= (IfLetExprConseqIfLet const &other) - { - IfLetExpr::operator= (other); - // match_arm_patterns = other.match_arm_patterns; - // value = other.value->clone_expr(); - // if_block = other.if_block->clone_block_expr(); - if_let_expr = other.if_let_expr->clone_if_let_expr (); - - return *this; - } - - // move constructors - IfLetExprConseqIfLet (IfLetExprConseqIfLet &&other) = default; - IfLetExprConseqIfLet &operator= (IfLetExprConseqIfLet &&other) = default; - - void accept_vis (ASTVisitor &vis) override; - - // TODO: is this better? Or is a "vis_block" better? - std::unique_ptr &get_conseq_if_let_expr () - { - rust_assert (if_let_expr != nullptr); - return if_let_expr; - } - -protected: - /* Use covariance to implement clone function as returning this object rather - * than base */ - IfLetExprConseqIfLet *clone_if_let_expr_impl () const override - { - return new IfLetExprConseqIfLet (*this); - } -}; - // Match arm expression struct MatchArm { diff --git a/gcc/rust/checks/errors/rust-feature-gate.h b/gcc/rust/checks/errors/rust-feature-gate.h index a4e2f90f0cf1..5d747047e189 100644 --- a/gcc/rust/checks/errors/rust-feature-gate.h +++ b/gcc/rust/checks/errors/rust-feature-gate.h @@ -97,8 +97,6 @@ public: void visit (AST::IfExprConseqElse &expr) override {} void visit (AST::IfLetExpr &expr) override {} void visit (AST::IfLetExprConseqElse &expr) override {} - void visit (AST::IfLetExprConseqIf &expr) override {} - void visit (AST::IfLetExprConseqIfLet &expr) override {} void visit (AST::MatchExpr &expr) override {} void visit (AST::AwaitExpr &expr) override {} void visit (AST::AsyncBlockExpr &expr) override {} diff --git a/gcc/rust/expand/rust-cfg-strip.cc b/gcc/rust/expand/rust-cfg-strip.cc index 926367aff0f2..0aebb6f19d43 100644 --- a/gcc/rust/expand/rust-cfg-strip.cc +++ b/gcc/rust/expand/rust-cfg-strip.cc @@ -1779,93 +1779,6 @@ CfgStrip::visit (AST::IfLetExprConseqElse &expr) "attributes not allowed"); } void -CfgStrip::visit (AST::IfLetExprConseqIf &expr) -{ - // initial strip test based on outer attrs - expand_cfg_attrs (expr.get_outer_attrs ()); - if (fails_cfg_with_expand (expr.get_outer_attrs ())) - { - expr.mark_for_strip (); - return; - } - - for (auto &pattern : expr.get_patterns ()) - { - pattern->accept_vis (*this); - if (pattern->is_marked_for_strip ()) - rust_error_at (pattern->get_locus (), - "cannot strip pattern in this position"); - } - - // can't strip value expr itself, but can strip sub-expressions - auto &value_expr = expr.get_value_expr (); - value_expr->accept_vis (*this); - if (value_expr->is_marked_for_strip ()) - rust_error_at (value_expr->get_locus (), - "cannot strip expression in this position - outer " - "attributes not allowed"); - - // can't strip if block itself, but can strip sub-expressions - auto &if_block = expr.get_if_block (); - if_block->accept_vis (*this); - if (if_block->is_marked_for_strip ()) - rust_error_at (if_block->get_locus (), - "cannot strip block expression in this position - outer " - "attributes not allowed"); - - // can't strip if expr itself, but can strip sub-expressions - auto &conseq_if_expr = expr.get_conseq_if_expr (); - conseq_if_expr->accept_vis (*this); - if (conseq_if_expr->is_marked_for_strip ()) - rust_error_at (conseq_if_expr->get_locus (), - "cannot strip consequent if expression in this " - "position - outer attributes not allowed"); -} -void -CfgStrip::visit (AST::IfLetExprConseqIfLet &expr) -{ - // initial strip test based on outer attrs - expand_cfg_attrs (expr.get_outer_attrs ()); - if (fails_cfg_with_expand (expr.get_outer_attrs ())) - { - expr.mark_for_strip (); - return; - } - - for (auto &pattern : expr.get_patterns ()) - { - pattern->accept_vis (*this); - if (pattern->is_marked_for_strip ()) - rust_error_at (pattern->get_locus (), - "cannot strip pattern in this position"); - } - - // can't strip value expr itself, but can strip sub-expressions - auto &value_expr = expr.get_value_expr (); - value_expr->accept_vis (*this); - if (value_expr->is_marked_for_strip ()) - rust_error_at (value_expr->get_locus (), - "cannot strip expression in this position - outer " - "attributes not allowed"); - - // can't strip if block itself, but can strip sub-expressions - auto &if_block = expr.get_if_block (); - if_block->accept_vis (*this); - if (if_block->is_marked_for_strip ()) - rust_error_at (if_block->get_locus (), - "cannot strip block expression in this position - outer " - "attributes not allowed"); - - // can't strip if let expr itself, but can strip sub-expressions - auto &conseq_if_let_expr = expr.get_conseq_if_let_expr (); - conseq_if_let_expr->accept_vis (*this); - if (conseq_if_let_expr->is_marked_for_strip ()) - rust_error_at (conseq_if_let_expr->get_locus (), - "cannot strip consequent if let expression in this " - "position - outer attributes not " - "allowed"); -} -void CfgStrip::visit (AST::MatchExpr &expr) { // initial strip test based on outer attrs diff --git a/gcc/rust/expand/rust-cfg-strip.h b/gcc/rust/expand/rust-cfg-strip.h index 41b548b51c26..d631b5a95100 100644 --- a/gcc/rust/expand/rust-cfg-strip.h +++ b/gcc/rust/expand/rust-cfg-strip.h @@ -133,8 +133,6 @@ public: void visit (AST::IfExprConseqElse &expr) override; void visit (AST::IfLetExpr &expr) override; void visit (AST::IfLetExprConseqElse &expr) override; - void visit (AST::IfLetExprConseqIf &expr) override; - void visit (AST::IfLetExprConseqIfLet &expr) override; void visit (AST::MatchExpr &expr) override; void visit (AST::AwaitExpr &expr) override; void visit (AST::AsyncBlockExpr &expr) override; diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc index 04013da8fffc..c4191ce68d1a 100644 --- a/gcc/rust/expand/rust-expand-visitor.cc +++ b/gcc/rust/expand/rust-expand-visitor.cc @@ -699,24 +699,6 @@ ExpandVisitor::visit (AST::IfLetExprConseqElse &expr) visit (expr.get_else_block ()); } -void -ExpandVisitor::visit (AST::IfLetExprConseqIf &expr) -{ - maybe_expand_expr (expr.get_value_expr ()); - - visit (expr.get_if_block ()); - visit (expr.get_conseq_if_expr ()); -} - -void -ExpandVisitor::visit (AST::IfLetExprConseqIfLet &expr) -{ - maybe_expand_expr (expr.get_value_expr ()); - - visit (expr.get_if_block ()); - visit (expr.get_conseq_if_let_expr ()); -} - void ExpandVisitor::visit (AST::MatchExpr &expr) { diff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h index 67c9a5558b6e..f3123767213f 100644 --- a/gcc/rust/expand/rust-expand-visitor.h +++ b/gcc/rust/expand/rust-expand-visitor.h @@ -218,8 +218,6 @@ public: void visit (AST::IfExprConseqElse &expr) override; void visit (AST::IfLetExpr &expr) override; void visit (AST::IfLetExprConseqElse &expr) override; - void visit (AST::IfLetExprConseqIf &expr) override; - void visit (AST::IfLetExprConseqIfLet &expr) override; void visit (AST::MatchExpr &expr) override; void visit (AST::AwaitExpr &expr) override; void visit (AST::AsyncBlockExpr &expr) override; diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc index 9c04c21881c3..70f57c344174 100644 --- a/gcc/rust/hir/rust-ast-lower-base.cc +++ b/gcc/rust/hir/rust-ast-lower-base.cc @@ -235,12 +235,6 @@ ASTLoweringBase::visit (AST::IfLetExpr &) void ASTLoweringBase::visit (AST::IfLetExprConseqElse &) {} -void -ASTLoweringBase::visit (AST::IfLetExprConseqIf &) -{} -void -ASTLoweringBase::visit (AST::IfLetExprConseqIfLet &) -{} // void ASTLoweringBase::visit(MatchCasematch_case) {} // void ASTLoweringBase:: (AST::MatchCaseBlockExpr &) {} // void ASTLoweringBase:: (AST::MatchCaseExpr &) {} diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h index 212277960a6b..f839eae21807 100644 --- a/gcc/rust/hir/rust-ast-lower-base.h +++ b/gcc/rust/hir/rust-ast-lower-base.h @@ -145,8 +145,6 @@ public: virtual void visit (AST::IfExprConseqElse &expr); virtual void visit (AST::IfLetExpr &expr); virtual void visit (AST::IfLetExprConseqElse &expr); - virtual void visit (AST::IfLetExprConseqIf &expr); - virtual void visit (AST::IfLetExprConseqIfLet &expr); // virtual void visit(MatchCase& match_case); // virtual void visit (AST::MatchCaseBlockExpr &match_case); // virtual void visit (AST::MatchCaseExpr &match_case); diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index c48c71f6ca33..e636252c2558 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -8219,8 +8219,8 @@ Parser::parse_if_let_expr (AST::AttrVec outer_attrs, return nullptr; } - return std::unique_ptr ( - new AST::IfLetExprConseqIfLet ( + return std::unique_ptr ( + new AST::IfLetExprConseqElse ( std::move (match_arm_patterns), std::move (scrutinee_expr), std::move (if_let_body), std::move (if_let_expr), std::move (outer_attrs), locus)); @@ -8240,12 +8240,11 @@ Parser::parse_if_let_expr (AST::AttrVec outer_attrs, return nullptr; } - return std::unique_ptr ( - new AST::IfLetExprConseqIf (std::move (match_arm_patterns), - std::move (scrutinee_expr), - std::move (if_let_body), - std::move (if_expr), - std::move (outer_attrs), locus)); + return std::unique_ptr ( + new AST::IfLetExprConseqElse ( + std::move (match_arm_patterns), std::move (scrutinee_expr), + std::move (if_let_body), std::move (if_expr), + std::move (outer_attrs), locus)); } } default: diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc index 06aeb06f967e..997a1538e4dc 100644 --- a/gcc/rust/resolve/rust-ast-resolve-base.cc +++ b/gcc/rust/resolve/rust-ast-resolve-base.cc @@ -302,14 +302,6 @@ void ResolverBase::visit (AST::IfLetExprConseqElse &) {} -void -ResolverBase::visit (AST::IfLetExprConseqIf &) -{} - -void -ResolverBase::visit (AST::IfLetExprConseqIfLet &) -{} - void ResolverBase::visit (AST::MatchExpr &) {} diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h index dc8796549c2a..136d63738589 100644 --- a/gcc/rust/resolve/rust-ast-resolve-base.h +++ b/gcc/rust/resolve/rust-ast-resolve-base.h @@ -97,8 +97,6 @@ public: void visit (AST::IfExprConseqElse &); void visit (AST::IfLetExpr &); void visit (AST::IfLetExprConseqElse &); - void visit (AST::IfLetExprConseqIf &); - void visit (AST::IfLetExprConseqIfLet &); void visit (AST::MatchExpr &); void visit (AST::AwaitExpr &); diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc index f06f1bc81985..6e869d6a7c92 100644 --- a/gcc/rust/resolve/rust-early-name-resolver.cc +++ b/gcc/rust/resolve/rust-early-name-resolver.cc @@ -473,22 +473,6 @@ EarlyNameResolver::visit (AST::IfLetExprConseqElse &expr) expr.get_else_block ()->accept_vis (*this); } -void -EarlyNameResolver::visit (AST::IfLetExprConseqIf &expr) -{ - expr.get_value_expr ()->accept_vis (*this); - expr.get_if_block ()->accept_vis (*this); - expr.get_conseq_if_expr ()->accept_vis (*this); -} - -void -EarlyNameResolver::visit (AST::IfLetExprConseqIfLet &expr) -{ - expr.get_value_expr ()->accept_vis (*this); - expr.get_if_block ()->accept_vis (*this); - expr.get_conseq_if_let_expr ()->accept_vis (*this); -} - void EarlyNameResolver::visit (AST::MatchExpr &expr) { diff --git a/gcc/rust/resolve/rust-early-name-resolver.h b/gcc/rust/resolve/rust-early-name-resolver.h index c6f800490d7c..07281378c5bb 100644 --- a/gcc/rust/resolve/rust-early-name-resolver.h +++ b/gcc/rust/resolve/rust-early-name-resolver.h @@ -179,8 +179,6 @@ private: virtual void visit (AST::IfExprConseqElse &expr); virtual void visit (AST::IfLetExpr &expr); virtual void visit (AST::IfLetExprConseqElse &expr); - virtual void visit (AST::IfLetExprConseqIf &expr); - virtual void visit (AST::IfLetExprConseqIfLet &expr); virtual void visit (AST::MatchExpr &expr); virtual void visit (AST::AwaitExpr &expr); virtual void visit (AST::AsyncBlockExpr &expr); diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 4281f2986449..03afad72bdd1 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -476,14 +476,6 @@ void AttributeChecker::visit (AST::IfLetExprConseqElse &) {} -void -AttributeChecker::visit (AST::IfLetExprConseqIf &) -{} - -void -AttributeChecker::visit (AST::IfLetExprConseqIfLet &) -{} - void AttributeChecker::visit (AST::MatchExpr &) {} diff --git a/gcc/rust/util/rust-attributes.h b/gcc/rust/util/rust-attributes.h index 1c642cdbac92..e8a1d273aea0 100644 --- a/gcc/rust/util/rust-attributes.h +++ b/gcc/rust/util/rust-attributes.h @@ -162,8 +162,6 @@ private: void visit (AST::IfExprConseqElse &expr); void visit (AST::IfLetExpr &expr); void visit (AST::IfLetExprConseqElse &expr); - void visit (AST::IfLetExprConseqIf &expr); - void visit (AST::IfLetExprConseqIfLet &expr); void visit (AST::MatchExpr &expr); void visit (AST::AwaitExpr &expr); void visit (AST::AsyncBlockExpr &expr);