From d93efa777e31b037d163bf26e1c93d05a0705912 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 18 Feb 2025 17:44:05 +0000 Subject: gccrs: remove visitor which is not needed here Just a small refactor to remove a visitor which is not needed. gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::Compile): remove visitor (ResolvePathRef::ResolvePathRef): likewise (ResolvePathRef::visit): likewise * backend/rust-compile-resolve-path.h (class ResolvePathRef): likewise Signed-off-by: Philip Herron --- gcc/rust/backend/rust-compile-resolve-path.h | 38 +++------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) (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 4eb0e22..b0713ab 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.h +++ b/gcc/rust/backend/rust-compile-resolve-path.h @@ -20,46 +20,18 @@ #define RUST_COMPILE_RESOLVE_PATH #include "rust-compile-base.h" -#include "rust-hir-visitor.h" namespace Rust { namespace Compile { -class ResolvePathRef : public HIRCompileBase, public HIR::HIRPatternVisitor +class ResolvePathRef : public HIRCompileBase { public: - static tree Compile (HIR::QualifiedPathInExpression &expr, Context *ctx) - { - ResolvePathRef resolver (ctx); - expr.accept_vis (resolver); - return resolver.resolved; - } + static tree Compile (HIR::QualifiedPathInExpression &expr, Context *ctx); - static tree Compile (HIR::PathInExpression &expr, Context *ctx) - { - ResolvePathRef resolver (ctx); - expr.accept_vis (resolver); - return resolver.resolved; - } + static tree Compile (HIR::PathInExpression &expr, Context *ctx); - void visit (HIR::PathInExpression &expr) override; - void visit (HIR::QualifiedPathInExpression &expr) override; - - // Empty visit for unused Pattern HIR nodes. - void visit (HIR::IdentifierPattern &) override {} - void visit (HIR::LiteralPattern &) override {} - 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 {} - void visit (HIR::WildcardPattern &) override {} - - ResolvePathRef (Context *ctx) - : HIRCompileBase (ctx), resolved (error_mark_node) - {} + ResolvePathRef (Context *ctx); /** * Generic visitor for both PathInExpression and QualifiedPathInExpression @@ -81,8 +53,6 @@ public: const Analysis::NodeMapping &mappings, location_t locus, bool is_qualified_path); - tree resolved; - private: tree attempt_constructor_expression_lookup (TyTy::BaseType *lookup, Context *ctx, -- cgit v1.1