aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-07 11:29:06 +0000
committerGitHub <noreply@github.com>2022-01-07 11:29:06 +0000
commitbc27d113167ec6c6cc96b01c8559fc9b9219417c (patch)
tree0fa63b2f89ed49d1b8b4a6c6c2ee20af30dd70c3 /gcc/rust/backend/rust-compile-expr.cc
parente082b6cfd0362b3bd8eacd65359812a0d34aa563 (diff)
parent6d0892636e9642e75a858c40c45acd1df79c63e1 (diff)
downloadgcc-bc27d113167ec6c6cc96b01c8559fc9b9219417c.zip
gcc-bc27d113167ec6c6cc96b01c8559fc9b9219417c.tar.gz
gcc-bc27d113167ec6c6cc96b01c8559fc9b9219417c.tar.bz2
Merge #866
866: Add support for wildcard patterns within MatchExprs r=philberty a=philberty GCC CASE_LABEL_EXPR's contain operand 0 and 1, operand 0 is used for the low value of a case label and operand 1 for a high value. So with this CASE_LABEL_EXPR is is possible to support a range of values from low->high if set apropriately, but for the wildcard case this is effectively a default case which means we set both operand 0 and 1 to NULL_TREE. Fixes #853 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc7
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index b77a4d5..5e43f5a 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -275,19 +275,12 @@ CompileExpr::visit (HIR::MatchExpr &expr)
tree case_label = ctx->get_backend ()->label (
fndecl, "" /* empty creates an artificial label */, arm_locus);
- // not sure if we need to add this to the block or if the CASE_LABEL_EXPR
- // does this implicitly
- //
- // tree case_label_decl_statement
- // = ctx->get_backend ()->label_definition_statement (case_label);
-
// setup the bindings for the block
for (auto &kase_pattern : kase_arm.get_patterns ())
{
tree switch_kase_expr
= CompilePatternCaseLabelExpr::Compile (kase_pattern.get (),
case_label, ctx);
- // ctx->add_statement (case_label_decl_statement);
ctx->add_statement (switch_kase_expr);
CompilePatternBindings::Compile (kase_pattern.get (),