From 19f4db6ef5263a578baef7e64bf9c9169bb771e6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 29 Jun 2022 16:05:10 -0700 Subject: [Strings] Add string.new* instructions (#4761) This is the first instruction from the Strings proposal. This includes everything but interpreter support. --- src/passes/Print.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/passes/Print.cpp') 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 -- cgit v1.2.3