diff options
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-resolve-path.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.h b/gcc/rust/backend/rust-compile-resolve-path.h index d8f393d..a5543d2 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.h +++ b/gcc/rust/backend/rust-compile-resolve-path.h @@ -25,27 +25,44 @@ namespace Rust { namespace Compile { -class ResolvePath : public HIRCompileBase +class ResolvePathRef : public HIRCompileBase { public: static Bexpression *Compile (HIR::Expr *expr, Context *ctx) { - ResolvePath resolver (ctx); + ResolvePathRef resolver (ctx); expr->accept_vis (resolver); rust_assert (resolver.resolved != nullptr); return resolver.resolved; } - virtual ~ResolvePath () {} - void visit (HIR::PathInExpression &expr); private: - ResolvePath (Context *ctx) : HIRCompileBase (ctx), resolved (nullptr) {} + ResolvePathRef (Context *ctx) : HIRCompileBase (ctx), resolved (nullptr) {} Bexpression *resolved; }; +class ResolvePathType : public HIRCompileBase +{ +public: + static Btype *Compile (HIR::Expr *expr, Context *ctx) + { + ResolvePathType resolver (ctx); + expr->accept_vis (resolver); + rust_assert (resolver.resolved != nullptr); + return resolver.resolved; + } + + void visit (HIR::PathInExpression &expr); + +private: + ResolvePathType (Context *ctx) : HIRCompileBase (ctx), resolved (nullptr) {} + + Btype *resolved; +}; + } // namespace Compile } // namespace Rust |