summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-01-25 15:29:21 -0800
committerGitHub <noreply@github.com>2023-01-25 23:29:21 +0000
commitb5476c6378e10350bf17080fae9bfd8ceeb83cd2 (patch)
tree85dc2d568a7d3dbed85f798a1039065bc6843bb2 /src/passes/Print.cpp
parent17d120a3337fe56567d4e45583db8ea62ee8bf6f (diff)
downloadbinaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.tar.gz
binaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.tar.bz2
binaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.zip
[Strings] Add string.compare (#5453)
See WebAssembly/stringref#58
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 38e88fde5..d9a4c38e5 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2424,7 +2424,18 @@ struct PrintExpressionContents
void visitStringConcat(StringConcat* curr) {
printMedium(o, "string.concat");
}
- void visitStringEq(StringEq* curr) { printMedium(o, "string.eq"); }
+ void visitStringEq(StringEq* curr) {
+ switch (curr->op) {
+ case StringEqEqual:
+ printMedium(o, "string.eq");
+ break;
+ case StringEqCompare:
+ printMedium(o, "string.compare");
+ break;
+ default:
+ WASM_UNREACHABLE("invalid string.eq*");
+ }
+ }
void visitStringAs(StringAs* curr) {
switch (curr->op) {
case StringAsWTF8: