diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2021-02-07 12:40:19 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2021-02-07 12:40:19 +0800 |
commit | 94be91d6159101caa7c560b188bd6c02d8d86d17 (patch) | |
tree | b3c32de54db1a850079f79d3dfb4c4000dec9d90 /gcc/rust/util/rust-hir-map.h | |
parent | 27eef5b7a065e8ea05ac575c4b364bb5dbc44e46 (diff) | |
parent | db7134353447921136a321b8fd78cea78f2c344e (diff) | |
download | gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.zip gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.gz gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.bz2 |
Merge branch 'master' of https://github.com/redbrain/gccrs
Diffstat (limited to 'gcc/rust/util/rust-hir-map.h')
-rw-r--r-- | gcc/rust/util/rust-hir-map.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h index f81cee6..0d625f6 100644 --- a/gcc/rust/util/rust-hir-map.h +++ b/gcc/rust/util/rust-hir-map.h @@ -125,6 +125,10 @@ public: void insert_hir_param (CrateNum crateNum, HirId id, HIR::FunctionParam *type); HIR::FunctionParam *lookup_hir_param (CrateNum crateNum, HirId id); + void insert_hir_self_param (CrateNum crateNum, HirId id, + HIR::SelfParam *type); + HIR::SelfParam *lookup_hir_self_param (CrateNum crateNum, HirId id); + void insert_hir_struct_field (CrateNum crateNum, HirId id, HIR::StructExprField *type); HIR::StructExprField *lookup_hir_struct_field (CrateNum crateNum, HirId id); @@ -152,6 +156,20 @@ public: return hirNodesWithinCrate[crate]; } + void + iterate_impl_items (std::function<bool (HirId, HIR::InherentImplItem *)> cb) + { + for (auto it = hirImplItemMappings.begin (); + it != hirImplItemMappings.end (); it++) + { + for (auto iy = it->second.begin (); iy != it->second.end (); iy++) + { + if (!cb (iy->first, iy->second)) + return; + } + } + } + private: Mappings (); @@ -176,6 +194,7 @@ private: hirStructFieldMappings; std::map<CrateNum, std::map<HirId, HIR::InherentImplItem *> > hirImplItemMappings; + std::map<CrateNum, std::map<HirId, HIR::SelfParam *> > hirSelfParamMappings; // location info std::map<CrateNum, std::map<NodeId, Location> > locations; |