aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-07-28 11:08:27 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-07-29 18:18:54 +0200
commitb38dee3d3808d43d5c25dba30259462eed93b2c0 (patch)
tree1ed0c2f53d0478509bb617b42094146a1e26e824 /gcc/rust/backend/rust-compile-resolve-path.cc
parente88a55ab6919346e0afe79bfd13f84ecf9634889 (diff)
downloadgcc-b38dee3d3808d43d5c25dba30259462eed93b2c0.zip
gcc-b38dee3d3808d43d5c25dba30259462eed93b2c0.tar.gz
gcc-b38dee3d3808d43d5c25dba30259462eed93b2c0.tar.bz2
mappings: Keep track of extern blocks
When inserting external items, it's interesting to also be able to lookup the extern block they were defined in, similarly to impl items. This is useful to know the ABI or other specifiers of the block the item has been declared in.
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 95d8841..b5bfa3c 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -159,8 +159,9 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
Location expr_locus, bool is_qualified_path)
{
HIR::Item *resolved_item = ctx->get_mappings ()->lookup_hir_item (ref);
+ HirId parent_block;
HIR::ExternalItem *resolved_extern_item
- = ctx->get_mappings ()->lookup_hir_extern_item (ref);
+ = ctx->get_mappings ()->lookup_hir_extern_item (ref, &parent_block);
bool is_hir_item = resolved_item != nullptr;
bool is_hir_extern_item = resolved_extern_item != nullptr;
if (is_hir_item)