From e1af468856241e339ad4f7b6c5af68d033b34b4c Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Mon, 20 Feb 2023 14:46:03 -0500 Subject: gccrs: Add AltPattern HIR node Example: match x { 0 | 1 => true, _ => false } gcc/rust/ChangeLog: * backend/rust-compile-fnparam.h: (CompileFnParam::visit): Add AltPattern visitor. * backend/rust-compile-pattern.h: (CompilePatternCaseLabelExpr::visit): Add AltPattern visitor. (CompilePatternBindings::visit): Add AltPattern visitor. (CompilePatternLet::visit): Add AltPattern visitor. * backend/rust-compile-resolve-path.h: (ResolvePathRef::visit): Add AltPattern visitor. * backend/rust-compile-var-decl.h: (CompileVarDecl::visit): Add AltPattern visitor. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Add AltPattern visitor. * checks/errors/rust-const-checker.h: (ConstChecker::visit): Add AltPattern visitor. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Add AltPattern visitor. * checks/errors/rust-unsafe-checker.h: (UnsafeChecker::visit): Add AltPattern visitor. * hir/rust-hir-dump.cc (Dump::visit): Add AltPattern visitor. * hir/rust-hir-dump.h: (Dump::visit): Add AltPattern visitor. * hir/tree/rust-hir-full-decls.h (class AltPattern): Add forward declaration. * hir/tree/rust-hir-pattern.h (class AltPattern): New class. * hir/tree/rust-hir-visitor.h: (HIRFullVisitor::visit): Add AltPattern visitor. (HIRFullVisitorBase::visit): Add AltPattern visitor. (HIRPatternVisitor::visit): Add AltPattern visitor. * hir/tree/rust-hir.h: (Pattern::PatternType::ALT): New enumerator. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add AltPattern visitor. * typecheck/rust-hir-type-check-pattern.h: (TypeCheckPattern::visit): Add AltPattern visitor. Signed-off-by: Owen Avery --- gcc/rust/backend/rust-compile-resolve-path.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/rust/backend/rust-compile-resolve-path.h') diff --git a/gcc/rust/backend/rust-compile-resolve-path.h b/gcc/rust/backend/rust-compile-resolve-path.h index 8aedb16..93b0a7f 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.h +++ b/gcc/rust/backend/rust-compile-resolve-path.h @@ -50,6 +50,7 @@ public: void visit (HIR::RangePattern &) override {} void visit (HIR::ReferencePattern &) override {} void visit (HIR::SlicePattern &) override {} + void visit (HIR::AltPattern &) override {} void visit (HIR::StructPattern &) override {} void visit (HIR::TuplePattern &) override {} void visit (HIR::TupleStructPattern &) override {} -- cgit v1.1