diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-06-03 13:13:35 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-06-10 17:09:34 +0100 |
commit | fc3ef6c4b1fad0d88a65043df8102437416b1df3 (patch) | |
tree | 2ec71d2e2b0a412ab1cc6647fd9607a13c0f51ef /gcc/rust/resolve/rust-ast-resolve-base.h | |
parent | e6d32d59f1e6524df667262c509910e44151bbf2 (diff) | |
download | gcc-fc3ef6c4b1fad0d88a65043df8102437416b1df3.zip gcc-fc3ef6c4b1fad0d88a65043df8102437416b1df3.tar.gz gcc-fc3ef6c4b1fad0d88a65043df8102437416b1df3.tar.bz2 |
Refactor how we track the current module scope id
This adds a module scope stack to the resolver class such that we don't
have to continually update our constructors but are able to track it as
part of this context class instead.
Addresses #1227
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-base.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-base.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h index 9c1f0a1..17d05c3 100644 --- a/gcc/rust/resolve/rust-ast-resolve-base.h +++ b/gcc/rust/resolve/rust-ast-resolve-base.h @@ -199,10 +199,9 @@ public: void visit (AST::BareFunctionType &); protected: - ResolverBase (NodeId parent, NodeId current_module = UNKNOWN_NODEID) + ResolverBase (NodeId parent) : resolver (Resolver::get ()), mappings (Analysis::Mappings::get ()), - resolved_node (UNKNOWN_NODEID), parent (parent), - current_module (current_module), locus (Location ()) + resolved_node (UNKNOWN_NODEID), parent (parent), locus (Location ()) {} bool resolved () const { return resolved_node != UNKNOWN_NODEID; } @@ -216,7 +215,6 @@ protected: Analysis::Mappings *mappings; NodeId resolved_node; NodeId parent; - NodeId current_module; Location locus; }; |