diff options
author | Alon Zakai <azakai@google.com> | 2022-06-29 16:05:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 16:05:10 -0700 |
commit | 19f4db6ef5263a578baef7e64bf9c9169bb771e6 (patch) | |
tree | d9608e8483415332b744701a714ec83d8e8009fb /src/passes/Print.cpp | |
parent | d252c3e9e5dee98150c5ac625b6deb0e95139ede (diff) | |
download | binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.gz binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.bz2 binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.zip |
[Strings] Add string.new* instructions (#4761)
This is the first instruction from the Strings proposal.
This includes everything but interpreter support.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 2aacb513b..c9ef1a224 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2203,6 +2203,24 @@ struct PrintExpressionContents WASM_UNREACHABLE("invalid ref.is_*"); } } + void visitStringNew(StringNew* curr) { + switch (curr->op) { + case StringNewUTF8: + printMedium(o, "string.new_wtf8 utf8"); + break; + case StringNewWTF8: + printMedium(o, "string.new_wtf8 wtf8"); + break; + case StringNewReplace: + printMedium(o, "string.new_wtf8 replace"); + break; + case StringNewWTF16: + printMedium(o, "string.new_wtf16"); + break; + default: + WASM_UNREACHABLE("invalid string.new*"); + } + } }; // Prints an expression in s-expr format, including both the |