]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Compile pattern match statements into conditional statements
authorOwen Avery <powerboat9.gamer@gmail.com>
Mon, 23 Oct 2023 01:44:01 +0000 (21:44 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:35 +0000 (19:09 +0100)
commitda87ef4d692b348be41c082eabb37f21af73f392
treeef6a74c39041b5191987608a3ba9a27faf9ad9be
parent3a874d936b2fcbb1c77b146d8b1d651e52eb618f
gccrs: Compile pattern match statements into conditional statements

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc
(patterns_mergeable): Remove.
(struct PatternMerge): Remove.
(sort_tuple_patterns): Remove.
(simplify_tuple_match): Remove.
(CompileExpr::visit): Modify compilation of MatchExpr.

* backend/rust-compile-pattern.cc
(CompilePatternCaseLabelExpr::visit): Replace with...
(CompilePatternCheckExpr::visit): ...this.
* backend/rust-compile-pattern.h
(class CompilePatternCaseLabelExpr): Replace with...
(class CompilePatternCheckExpr): ...this.

* backend/rust-compile-type.cc
(TyTyResolveCompile::get_implicit_enumeral_node_type):
Make enumeral type equivalent to isize.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/backend/rust-compile-pattern.cc
gcc/rust/backend/rust-compile-pattern.h
gcc/rust/backend/rust-compile-type.cc