aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNala Ginrut <mulei@gnu.org>2020-05-21 00:58:29 +0800
committerPhilip Herron <philip.herron@embecosm.com>2020-11-28 21:13:14 +0000
commita98e889e9af0ad8ee4da211f6f8efb67a89cab7a (patch)
treefd6d336fc3c4a74d85254b22a7b8ec2adb83bafd
parente83e46cd082ad4dfdced2eba3369f7e3ae3802ec (diff)
downloadgcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.zip
gcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.tar.gz
gcc-a98e889e9af0ad8ee4da211f6f8efb67a89cab7a.tar.bz2
Move scoping to Resolution class
-rw-r--r--gcc/rust/analysis/rust-resolution.h15
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;