summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2023-12-20 17:38:40 -0800
committerGitHub <noreply@github.com>2023-12-20 17:38:40 -0800
commit98cef80eabe2171bb3076767d68b25a85d268c12 (patch)
tree8738030d91e5b12ddfe12515049d5d47c2ab494b /test/example
parentfb7d00b336c8d682cbaaf02c96dab64b39d941ba (diff)
downloadbinaryen-98cef80eabe2171bb3076767d68b25a85d268c12.tar.gz
binaryen-98cef80eabe2171bb3076767d68b25a85d268c12.tar.bz2
binaryen-98cef80eabe2171bb3076767d68b25a85d268c12.zip
Unify method pairs with and without Type param (#6184)
As suggested in https://github.com/WebAssembly/binaryen/pull/6181#discussion_r1427188670, using `std::optional<Type>`, this unifies two different versions of `make***`, for block-like structures (`block`, `if`, `loop`, `try`, and `try_table`) with and without a type parameter. This also allows unifying of `finalize` methods, with and without a type. This also sets `breakability` argument of `Block::finalize` to `Unknown` so we can only have one `Block::finalize` that handles all cases. This also adds an optional `std::optional<Type> type` parameter to `blockifyWithName`, and `makeSequence` functions in `wasm-builder.h`. blockify was not included because it has a variadic parameter.
Diffstat (limited to 'test/example')
-rw-r--r--test/example/stack-utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/example/stack-utils.cpp b/test/example/stack-utils.cpp
index f8824e5cb..e393e13e3 100644
--- a/test/example/stack-utils.cpp
+++ b/test/example/stack-utils.cpp
@@ -24,7 +24,7 @@ void test_remove_nops() {
builder.makeNop(),
builder.makeNop(),
},
- {Type::i32, Type::i64});
+ Type{Type::i32, Type::i64});
std::cout << *block << '\n';
StackUtils::removeNops(block);
std::cout << *block << '\n';