aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-hir-map.h
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/util/rust-hir-map.h
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/util/rust-hir-map.h')
-rw-r--r--gcc/rust/util/rust-hir-map.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h
index c8cebef..98fcfe6 100644
--- a/gcc/rust/util/rust-hir-map.h
+++ b/gcc/rust/util/rust-hir-map.h
@@ -115,8 +115,11 @@ public:
void insert_hir_trait_item (HIR::TraitItem *item);
HIR::TraitItem *lookup_hir_trait_item (HirId id);
- void insert_hir_extern_item (HIR::ExternalItem *item);
- HIR::ExternalItem *lookup_hir_extern_item (HirId id);
+ void insert_hir_extern_block (HIR::ExternBlock *block);
+ HIR::ExternBlock *lookup_hir_extern_block (HirId id);
+
+ void insert_hir_extern_item (HIR::ExternalItem *item, HirId parent_block);
+ HIR::ExternalItem *lookup_hir_extern_item (HirId id, HirId *parent_block);
void insert_hir_impl_block (HIR::ImplBlock *item);
HIR::ImplBlock *lookup_hir_impl_block (HirId id);
@@ -312,7 +315,8 @@ private:
std::map<HirId, HIR::ImplBlock *> hirImplItemsToImplMappings;
std::map<HirId, HIR::ImplBlock *> hirImplBlockMappings;
std::map<HirId, HIR::TraitItem *> hirTraitItemMappings;
- std::map<HirId, HIR::ExternalItem *> hirExternItemMappings;
+ std::map<HirId, HIR::ExternBlock *> hirExternBlockMappings;
+ std::map<HirId, std::pair<HIR::ExternalItem *, HirId>> hirExternItemMappings;
std::map<HirId, HIR::PathExprSegment *> hirPathSegMappings;
std::map<HirId, HIR::GenericParam *> hirGenericParamMappings;
std::map<HirId, HIR::Trait *> hirTraitItemsToTraitMappings;