summaryrefslogtreecommitdiff
path: root/src/tools/wasm-shell.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-04-17 13:49:21 -0700
committerGitHub <noreply@github.com>2024-04-17 13:49:21 -0700
commit4a84a4b047021dfefd59d5d6dfd53e55c99f6d8d (patch)
treea52032a27348c7b39778f032d5809d024bfe1fff /src/tools/wasm-shell.cpp
parentd8dc55ceafff2c3b92d7d3e6434d56d346f8913b (diff)
downloadbinaryen-4a84a4b047021dfefd59d5d6dfd53e55c99f6d8d.tar.gz
binaryen-4a84a4b047021dfefd59d5d6dfd53e55c99f6d8d.tar.bz2
binaryen-4a84a4b047021dfefd59d5d6dfd53e55c99f6d8d.zip
[Parser] Preserve try labels (#6505)
In the standard text format, try scopes can be targeted by both normal branches and delegates, but in Binaryen IR we only allow them to be targeted by delegates, so we have to translate branches to try scopes into branches to wrapper blocks instead. These wrapper blocks must have different names than the try expressions they wrap, so we actually need to track two label names for try expressions: one for delegates and another for normal branches. We previously tried to avoid this complexity by tracking only the branch label and computing the delegate label from the branch label as necessary, but that produced unnecessary wrapper blocks and ugly label names that did not appear in the source. To produce better IR and minimize the diff when switching to the new text parser, bite the bullet and track the delegate and branch label names separately. This eliminates unnecessary wrapper blocks and keeps try names the same as in the wat source where possible.
Diffstat (limited to 'src/tools/wasm-shell.cpp')
0 files changed, 0 insertions, 0 deletions