diff options
author | Jérôme Vouillon <jerome.vouillon@gmail.com> | 2023-08-23 22:47:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 13:47:33 -0700 |
commit | 6dad9fb15130515bc7eed60270263f3d8269b60f (patch) | |
tree | 3c5f9982b014d870a3a87d19fa63cf015c7197d6 /src | |
parent | f6867f9a485c125dcd2914f58e2636f01879db7b (diff) | |
download | binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.tar.gz binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.tar.bz2 binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.zip |
Use the standard syntax for ref.cast, ref.test and array.new_fixed (#5894)
* Update text output for `ref.cast` and `ref.test`
* Update text output for `array.new_fixed`
* Update tests with new syntax for `ref.cast` and `ref.test`
* Update tests with new `array.new_fixed` syntax
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 4e7ae3730..5ab386ceb 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2093,21 +2093,14 @@ struct PrintExpressionContents } void visitRefTest(RefTest* curr) { printMedium(o, "ref.test "); - if (curr->castType.isNullable()) { - printMedium(o, "null "); - } - printHeapType(o, curr->castType.getHeapType(), wasm); + printType(o, curr->castType, wasm); } void visitRefCast(RefCast* curr) { if (printUnreachableReplacement(curr)) { return; } - if (curr->type.isNullable()) { - printMedium(o, "ref.cast null "); - } else { - printMedium(o, "ref.cast "); - } - printHeapType(o, curr->type.getHeapType(), wasm); + printMedium(o, "ref.cast "); + printType(o, curr->type, wasm); } void visitBrOn(BrOn* curr) { @@ -2224,6 +2217,8 @@ struct PrintExpressionContents printMedium(o, "array.new_fixed"); o << ' '; TypeNamePrinter(o, wasm).print(curr->type.getHeapType()); + o << ' '; + o << curr->values.size(); } void visitArrayGet(ArrayGet* curr) { if (printUnreachableOrNullReplacement(curr->ref)) { |