diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-02-18 17:44:05 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-03-14 16:36:36 +0000 |
commit | d93efa777e31b037d163bf26e1c93d05a0705912 (patch) | |
tree | 5b5841e08e6a2e1851f26e04daf31ce6055f5c67 /gcc/rust/backend/rust-compile-resolve-path.cc | |
parent | 3621c8d3a888f5059e51e69541d4dc8ec183cd2e (diff) | |
download | gcc-d93efa777e31b037d163bf26e1c93d05a0705912.zip gcc-d93efa777e31b037d163bf26e1c93d05a0705912.tar.gz gcc-d93efa777e31b037d163bf26e1c93d05a0705912.tar.bz2 |
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 <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-resolve-path.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 1b9dee6..9423951 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -32,6 +32,22 @@ namespace Rust { namespace Compile { +tree +ResolvePathRef::Compile (HIR::QualifiedPathInExpression &expr, Context *ctx) +{ + ResolvePathRef resolver (ctx); + return resolver.resolve_path_like (expr); +} + +tree +ResolvePathRef::Compile (HIR::PathInExpression &expr, Context *ctx) +{ + ResolvePathRef resolver (ctx); + return resolver.resolve_path_like (expr); +} + +ResolvePathRef::ResolvePathRef (Context *ctx) : HIRCompileBase (ctx) {} + template <typename T> tree ResolvePathRef::resolve_path_like (T &expr) @@ -53,18 +69,6 @@ ResolvePathRef::resolve_path_like (T &expr) expr.get_mappings (), expr.get_locus (), true); } -void -ResolvePathRef::visit (HIR::QualifiedPathInExpression &expr) -{ - resolved = resolve_path_like (expr); -} - -void -ResolvePathRef::visit (HIR::PathInExpression &expr) -{ - resolved = resolve_path_like (expr); -} - tree ResolvePathRef::attempt_constructor_expression_lookup ( TyTy::BaseType *lookup, Context *ctx, const Analysis::NodeMapping &mappings, |