aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-03-10 16:05:18 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2025-03-17 10:42:53 +0000
commit2c744b13326636a196dd2d7febe3928900078a9d (patch)
tree4c5def194473c8b67f5cdaab80e8ba03259c2962 /gcc
parentb08becd6cbbf129e0b502dae862d935fec58724a (diff)
downloadgcc-2c744b13326636a196dd2d7febe3928900078a9d.zip
gcc-2c744b13326636a196dd2d7febe3928900078a9d.tar.gz
gcc-2c744b13326636a196dd2d7febe3928900078a9d.tar.bz2
Insert crate name in canonical path
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Insert a new segment with the crate's name as canonical's path prefix. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/resolve/rust-forever-stack.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index fcd50af..c52cb7d 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -704,7 +704,12 @@ ForeverStack<N>::to_canonical_path (NodeId id) const
return KeepGoing::Yes;
});
- auto path = Resolver::CanonicalPath::create_empty ();
+ auto &mappings = Analysis::Mappings::get ();
+ CrateNum crate_num = mappings.lookup_crate_num (root.id).value ();
+ auto path = Resolver::CanonicalPath::new_seg (
+ root.id, mappings.get_crate_name (crate_num).value ());
+ path.set_crate_num (crate_num);
+
for (const auto &segment : segments)
path = path.append (segment);