public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Make mappings as part of the class
@ 2022-06-08 11:53 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5a73de5ee915b9eaa24d7b04b703b8bdfea0d754

commit 5a73de5ee915b9eaa24d7b04b703b8bdfea0d754
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Mon Nov 22 17:30:31 2021 +0000

    Make mappings as part of the class

Diff:
---
 gcc/rust/resolve/rust-name-resolver.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/resolve/rust-name-resolver.h b/gcc/rust/resolve/rust-name-resolver.h
index 08afc9d3e71..f03fe06bc9c 100644
--- a/gcc/rust/resolve/rust-name-resolver.h
+++ b/gcc/rust/resolve/rust-name-resolver.h
@@ -33,7 +33,8 @@ public:
   // Rust uses local_def_ids assigned by def_collector on the AST
   // lets use NodeId instead
   Rib (CrateNum crateNum, NodeId node_id)
-    : crate_num (crateNum), node_id (node_id)
+    : crate_num (crateNum), node_id (node_id),
+      mappings (Analysis::Mappings::get ())
   {}
 
   ~Rib () {}
@@ -59,8 +60,6 @@ public:
     reverse_path_mappings.insert (std::pair<NodeId, CanonicalPath> (id, path));
     decls_within_rib.insert (std::pair<NodeId, Location> (id, locus));
     references[id] = {};
-
-    auto mappings = Analysis::Mappings::get ();
     mappings->insert_canonical_path (mappings->get_current_crate (), id, path);
   }
 
@@ -155,6 +154,7 @@ private:
   std::map<NodeId, CanonicalPath> reverse_path_mappings;
   std::map<NodeId, Location> decls_within_rib;
   std::map<NodeId, std::set<NodeId>> references;
+  Analysis::Mappings *mappings;
 };
 
 class Scope


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:53 [gcc/devel/rust/master] Make mappings as part of the class 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).