WebAssembly / WebAssembly/binaryen
Add a ControlChildIterator to parallel ValueChildIterator
Open
@ashleynh is already working on this.
Since Jun 30, 2023.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
Maybe we can add a ControlChildIterator to parallel ValueChildIterator, that iterates on control flow children, and use that here? It would avoid us needing to update this code each time we add or modify a control flow structure (i.e. it would keep that logic in `iterator.h`.
I mean, in the code here, we could have:
for (auto* child : ControlChildIterator(curr)) {
this->addUniqueSymbol();
Super::walk(child);
}
However that won't work for block, I guess... so we need some special casing here anyhow. Maybe it's not worth it then.
Another option might be BlockChildIterator or such, as what we look for here is a child that is a new block scope..?
Originally posted by @kripken in https://github.com/WebAssembly/binaryen/pull/5772#discussion_r1247115668
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.