diff options
author | Nala Ginrut <mulei@gnu.org> | 2020-05-21 00:58:29 +0800 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2020-11-28 21:13:14 +0000 |
commit | a98e889e9af0ad8ee4da211f6f8efb67a89cab7a (patch) | |
tree | fd6d336fc3c4a74d85254b22a7b8ec2adb83bafd /gcc/rust/analysis | |
parent | e83e46cd082ad4dfdced2eba3369f7e3ae3802ec (diff) | |
download | gcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.zip gcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.tar.gz gcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.tar.bz2 |
Move scoping to Resolution class
Diffstat (limited to 'gcc/rust/analysis')
-rw-r--r-- | gcc/rust/analysis/rust-resolution.h | 15 |
1 files changed, 13 insertions, 2 deletions
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<AST::Type *> scope; + Scope<AST::Type *> valueScope; + Scope<AST::Type *> macroScope; Scope<AST::Type *> typeScope; + AST::Crate &crate; TopLevelScan &toplevel; |