summaryrefslogtreecommitdiff
path: root/src/passes/OptimizeInstructions.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-04-20 18:03:54 -0700
committerGitHub <noreply@github.com>2021-04-20 18:03:54 -0700
commiteb2581d89fee86ac11a1452a946f9c69d4173a48 (patch)
tree7e36052d5a1a2aaf75d00bc8b952e3ed9d26d00c /src/passes/OptimizeInstructions.cpp
parent304658d67102d3ddd5aa8ea59bcc94402d8338b8 (diff)
downloadbinaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.tar.gz
binaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.tar.bz2
binaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.zip
Refactor Child*Iterator for simplicity and to allow modifications. NFC (#3826)
Instead of creating a class and doing a traversal, simply use wasm-delegates-fields to get the children directly. This is simpler and faster. This requires a new way to override the behavior by ChildValueIterator. I ended up using CRTP. This stores pointers to the children instead of the children. This will allow modifying the children using these classes (which is the reason I started this refactoring - next PR will use it). This is also slightly faster in theory as we avoid doing loads from memory to find the children (which maybe we never get to doing if the iteration is stopped early). Not the goal here, but this speeds up roundtripping by 12%. This is NFC as nothing uses the new ability to modify things yet.
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
0 files changed, 0 insertions, 0 deletions