From a98e889e9af0ad8ee4da211f6f8efb67a89cab7a Mon Sep 17 00:00:00 2001 From: Nala Ginrut Date: Thu, 21 May 2020 00:58:29 +0800 Subject: Move scoping to Resolution class --- gcc/rust/analysis/rust-resolution.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'gcc/rust/analysis/rust-resolution.h') diff --git a/gcc/rust/analysis/rust-resolution.h b/gcc/rust/analysis/rust-resolution.h index 0105a8b..40a4d50 100644 --- a/gcc/rust/analysis/rust-resolution.h +++ b/gcc/rust/analysis/rust-resolution.h @@ -12,7 +12,13 @@ namespace Analysis { class Resolution : public AST::ASTVisitor { public: - ~Resolution (){}; + virtual ~Resolution () + { + scope.Pop (); + valueScope.Pop (); + macroScope.Pop (); + typeScope.Pop (); + }; // visitor impl // rust-ast.h @@ -226,12 +232,17 @@ protected: Resolution (AST::Crate &crate, TopLevelScan &toplevel) : crate (crate), toplevel (toplevel) { - typeScope.Push (); scope.Push (); + valueScope.Push (); + macroScope.Push (); + typeScope.Push (); }; Scope scope; + Scope valueScope; + Scope macroScope; Scope typeScope; + AST::Crate &crate; TopLevelScan &toplevel; -- cgit v1.1