public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] refacor resolution of TypePaths to be a static function
@ 2022-06-29 10:28 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-29 10:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:700849ffd066855f9d831a6bb34d4fc3de30ed50
commit 700849ffd066855f9d831a6bb34d4fc3de30ed50
Author: Philip Herron <philip.herron@embecosm.com>
Date: Tue Jun 28 13:31:24 2022 +0100
refacor resolution of TypePaths to be a static function
Diff:
---
gcc/rust/resolve/rust-ast-resolve-type.cc | 12 ++----------
gcc/rust/resolve/rust-ast-resolve-type.h | 7 +------
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 902f034781e..275f241e4b6 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 8bbb587cb6f..86008308c6a 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-29 10:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 10:28 [gcc/devel/rust/master] refacor resolution of TypePaths to be a static function Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).