diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-08-19 21:12:31 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-08-20 13:32:14 +0100 |
commit | 048261647afd1a08f681b78c90c58a9baaeef76d (patch) | |
tree | 47dc551f706c4015c017a299a4054cb7db460857 /gcc/rust/util/rust-canonical-path.h | |
parent | 1dc718474044149ec1aa6bee9ea8e83d778f17f2 (diff) | |
download | gcc-048261647afd1a08f681b78c90c58a9baaeef76d.zip gcc-048261647afd1a08f681b78c90c58a9baaeef76d.tar.gz gcc-048261647afd1a08f681b78c90c58a9baaeef76d.tar.bz2 |
Add qualified path support
Qualified paths need to lookup the associated trait item and mangle the
names apropriatly.
Diffstat (limited to 'gcc/rust/util/rust-canonical-path.h')
-rw-r--r-- | gcc/rust/util/rust-canonical-path.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-canonical-path.h b/gcc/rust/util/rust-canonical-path.h index d6ba90d..b5f8dd7 100644 --- a/gcc/rust/util/rust-canonical-path.h +++ b/gcc/rust/util/rust-canonical-path.h @@ -110,6 +110,17 @@ public: } } + void iterate_segs (std::function<bool (const CanonicalPath &)> cb) const + { + for (auto &seg : segs) + { + std::vector<std::pair<NodeId, std::string>> buf; + buf.push_back ({seg.first, seg.second}); + if (!cb (CanonicalPath (buf))) + return; + } + } + size_t size () const { return segs.size (); } NodeId get_id () const |