aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-06-28 13:31:24 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-06-28 13:31:24 +0100
commit700849ffd066855f9d831a6bb34d4fc3de30ed50 (patch)
tree536431aca73f2e29afccec6c034d9ed637d45776 /gcc
parenteb88a919f5395e9000126a8c78c97591711383a4 (diff)
downloadgcc-700849ffd066855f9d831a6bb34d4fc3de30ed50.zip
gcc-700849ffd066855f9d831a6bb34d4fc3de30ed50.tar.gz
gcc-700849ffd066855f9d831a6bb34d4fc3de30ed50.tar.bz2
refacor resolution of TypePaths to be a static function
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-type.cc12
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-type.h7
2 files changed, 3 insertions, 16 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc
index 902f034..275f241 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-type.cc
@@ -245,19 +245,11 @@ ResolveType::visit (AST::SliceType &type)
// resolve relative type-paths
-ResolveRelativeTypePath::ResolveRelativeTypePath (CanonicalPath qualified_path)
- : ResolveTypeToCanonicalPath (true, true)
-{
- result = qualified_path;
-}
-
bool
ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id)
{
- CanonicalPath result = CanonicalPath::create_empty ();
- ResolveRelativeTypePath o (result);
- auto &resolver = o.resolver;
- auto &mappings = o.mappings;
+ auto resolver = Resolver::get ();
+ auto mappings = Analysis::Mappings::get ();
NodeId module_scope_id = resolver->peek_current_module_scope ();
NodeId previous_resolved_node_id = module_scope_id;
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/rust-ast-resolve-type.h
index 8bbb587..8600830 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.h
+++ b/gcc/rust/resolve/rust-ast-resolve-type.h
@@ -79,15 +79,10 @@ protected:
bool failure_flag;
};
-class ResolveRelativeTypePath : public ResolveTypeToCanonicalPath
+class ResolveRelativeTypePath
{
- using ResolveTypeToCanonicalPath::visit;
-
public:
static bool go (AST::TypePath &path, NodeId &resolved_node_id);
-
-private:
- ResolveRelativeTypePath (CanonicalPath qualified_path);
};
class ResolveRelativeQualTypePath : public ResolverBase