From f98ccb3a0bcf6a49b4e1f2080f7f58fe39794fdf Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Sat, 10 Apr 2021 15:27:56 +0100 Subject: Refactor backend PathInExpr This method only ever should accept HIR::PathInExpressions. --- gcc/rust/backend/rust-compile-expr.h | 2 +- gcc/rust/backend/rust-compile-resolve-path.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/rust/backend') diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index d0c752c..f98ebc6 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -526,7 +526,7 @@ public: void visit (HIR::PathInExpression &expr) override { - translated = ResolvePathRef::Compile (&expr, ctx); + translated = ResolvePathRef::Compile (expr, ctx); } void visit (HIR::LoopExpr &expr) override diff --git a/gcc/rust/backend/rust-compile-resolve-path.h b/gcc/rust/backend/rust-compile-resolve-path.h index da1d97e..30486d0 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.h +++ b/gcc/rust/backend/rust-compile-resolve-path.h @@ -30,10 +30,10 @@ class ResolvePathRef : public HIRCompileBase using Rust::Compile::HIRCompileBase::visit; public: - static Bexpression *Compile (HIR::Expr *expr, Context *ctx) + static Bexpression *Compile (HIR::PathInExpression &expr, Context *ctx) { ResolvePathRef resolver (ctx); - expr->accept_vis (resolver); + expr.accept_vis (resolver); return resolver.resolved; } -- cgit v1.1