aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-item.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-07-08 15:13:57 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-07-15 11:59:38 +0100
commit6bf6241f29e73678b8c7d3508cdb39b55ae9d1ab (patch)
tree11bfbd4b50e747d310ed1d596032c49b3cd6b710 /gcc/rust/resolve/rust-ast-resolve-item.cc
parentf51284b598863eb0cbeb2984fd1499a672f2191d (diff)
downloadgcc-6bf6241f29e73678b8c7d3508cdb39b55ae9d1ab.zip
gcc-6bf6241f29e73678b8c7d3508cdb39b55ae9d1ab.tar.gz
gcc-6bf6241f29e73678b8c7d3508cdb39b55ae9d1ab.tar.bz2
External Items with Rust ABI need to mangle the full path
When compiling external rust abi item requires the fully qualified canonical path to be mangled in order to link correctly.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-item.cc')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index 244bf64..75bd2e1 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -1027,6 +1027,12 @@ void
ResolveExternItem::visit (AST::ExternalFunctionItem &function)
{
NodeId scope_node_id = function.get_node_id ();
+ auto decl = CanonicalPath::new_seg (function.get_node_id (),
+ function.get_identifier ());
+ auto path = prefix.append (decl);
+ auto cpath = canonical_prefix.append (decl);
+
+ mappings->insert_canonical_path (function.get_node_id (), cpath);
resolve_visibility (function.get_visibility ());