diff options
author | Alon Zakai <azakai@google.com> | 2021-03-29 15:32:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 15:32:01 -0700 |
commit | 09cba0fa50b0492ecf7b7886180dbd6c5aa5d04d (patch) | |
tree | bc654bcc92cab64a08fe0bd9197c2f9c4a324ca4 /src/ir/utils.h | |
parent | 244f886cb2f1d9c5dddbf2dea5d47e6b0a434c5d (diff) | |
download | binaryen-09cba0fa50b0492ecf7b7886180dbd6c5aa5d04d.tar.gz binaryen-09cba0fa50b0492ecf7b7886180dbd6c5aa5d04d.tar.bz2 binaryen-09cba0fa50b0492ecf7b7886180dbd6c5aa5d04d.zip |
Scan module-level code in necessary places (#3744)
Several old passes like DeadArgumentElimination and DuplicateFunctionElimination
need to look at all ref.funcs, and they scanned functions for that, but that is not
enough as such an instruction might appear in a global initializer. To fix this, add a
walkModuleCode method.
walkModuleCode is useful when doing the pattern of creating a function-parallel
pass to scan functions quickly, but we also want to do the same scanning of code
at the module level. This allows doing so in a single line.
(It is also possible to just do walk() on the entire module, which will find all code,
but that is not function-parallel. Perhaps we should have a walkParallel() option
to simplify this further in a followup, and that would call walkModuleCode afterwards
etc.)
Also add some missing validation and comments in the validator about issues that
I noticed in relation to the new testcases here.
Diffstat (limited to 'src/ir/utils.h')
0 files changed, 0 insertions, 0 deletions