public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] refacor resolution of TypePaths to be a static function Date: Wed, 29 Jun 2022 10:28:00 +0000 (GMT) [thread overview] Message-ID: <20220629102800.D3F1C3842AC9@sourceware.org> (raw) 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
reply other threads:[~2022-06-29 10:28 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220629102800.D3F1C3842AC9@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).