aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-pattern.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-01-06 14:45:15 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-01-06 15:35:28 +0000
commit6d0892636e9642e75a858c40c45acd1df79c63e1 (patch)
tree33ecc66b2e24693d103e9531a8d336ef49d7e896 /gcc/rust/backend/rust-compile-pattern.h
parent69f6be3ee483c9895b4b5187a44b3e1c8be2ba63 (diff)
downloadgcc-6d0892636e9642e75a858c40c45acd1df79c63e1.zip
gcc-6d0892636e9642e75a858c40c45acd1df79c63e1.tar.gz
gcc-6d0892636e9642e75a858c40c45acd1df79c63e1.tar.bz2
Add support for wildcard patterns within MatchExprs
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
Diffstat (limited to 'gcc/rust/backend/rust-compile-pattern.h')
-rw-r--r--gcc/rust/backend/rust-compile-pattern.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-pattern.h b/gcc/rust/backend/rust-compile-pattern.h
index e49f75c..b12ea93 100644
--- a/gcc/rust/backend/rust-compile-pattern.h
+++ b/gcc/rust/backend/rust-compile-pattern.h
@@ -40,6 +40,8 @@ public:
void visit (HIR::TupleStructPattern &pattern) override;
+ void visit (HIR::WildcardPattern &pattern) override;
+
private:
CompilePatternCaseLabelExpr (Context *ctx, tree associated_case_label)
: HIRCompileBase (ctx), case_label_expr (error_mark_node),