]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Unify AST::IfLetExprConseqIf{,Let} into AST::IfLetExprConseqElse
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 16 Mar 2023 03:30:19 +0000 (23:30 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:08 +0000 (18:34 +0100)
commitf2df348dcd5c7ef51e5a686a4d2473ae9bbb36bb
treeb04421abddf75f0a0f5ebf5ece8b00c194c1a4ef
parent7d8de1ca4a78ec7bf9cdd7e5cbe9d11bd2546efe
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 <powerboat9.gamer@gmail.com>
22 files changed:
gcc/rust/ast/rust-ast-dump.cc
gcc/rust/ast/rust-ast-dump.h
gcc/rust/ast/rust-ast-full-decls.h
gcc/rust/ast/rust-ast-tokenstream.cc
gcc/rust/ast/rust-ast-tokenstream.h
gcc/rust/ast/rust-ast-visitor.h
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-expr.h
gcc/rust/checks/errors/rust-feature-gate.h
gcc/rust/expand/rust-cfg-strip.cc
gcc/rust/expand/rust-cfg-strip.h
gcc/rust/expand/rust-expand-visitor.cc
gcc/rust/expand/rust-expand-visitor.h
gcc/rust/hir/rust-ast-lower-base.cc
gcc/rust/hir/rust-ast-lower-base.h
gcc/rust/parse/rust-parse-impl.h
gcc/rust/resolve/rust-ast-resolve-base.cc
gcc/rust/resolve/rust-ast-resolve-base.h
gcc/rust/resolve/rust-early-name-resolver.cc
gcc/rust/resolve/rust-early-name-resolver.h
gcc/rust/util/rust-attributes.cc
gcc/rust/util/rust-attributes.h