diff options
author | Thomas Lively <tlively@google.com> | 2024-11-14 21:22:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 18:22:34 -0800 |
commit | 49c45ac1675d787e7151f9beafcae479936aa9f3 (patch) | |
tree | 1abb2ebffdb57d43e92615f4a166dc61532dbeef /test/gtest | |
parent | 6efd41779272d2ac7eb75705c21c9f437a1409c9 (diff) | |
download | binaryen-49c45ac1675d787e7151f9beafcae479936aa9f3.tar.gz binaryen-49c45ac1675d787e7151f9beafcae479936aa9f3.tar.bz2 binaryen-49c45ac1675d787e7151f9beafcae479936aa9f3.zip |
Use empty blocks instead of nops for empty scopes in IRBuilder (#7080)
When IRBuilder builds an empty non-block scope such as a function body,
an if arm, a try block, etc, it needs to produce some expression to
represent the empty contents. Previously it produced a nop, but change
it to produce an empty block instead. The binary writer and printer have
special logic to elide empty blocks, so this produces smaller output.
Update J2CLOpts to recognize functions containing empty blocks as
trivial to avoid regressing one of its tests.
Diffstat (limited to 'test/gtest')
-rw-r--r-- | test/gtest/cfg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/gtest/cfg.cpp b/test/gtest/cfg.cpp index b8d26caa4..35ccf855b 100644 --- a/test/gtest/cfg.cpp +++ b/test/gtest/cfg.cpp @@ -149,7 +149,7 @@ TEST_F(CFGTest, Empty) { ;; entry ;; exit 0: - 0: nop + 0: block )cfg"; Module wasm; |