summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-06-29 16:05:10 -0700
committerGitHub <noreply@github.com>2022-06-29 16:05:10 -0700
commit19f4db6ef5263a578baef7e64bf9c9169bb771e6 (patch)
treed9608e8483415332b744701a714ec83d8e8009fb /src/wasm-builder.h
parentd252c3e9e5dee98150c5ac625b6deb0e95139ede (diff)
downloadbinaryen-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/wasm-builder.h')
-rw-r--r--src/wasm-builder.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 20babacf1..7eebf3f04 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -989,6 +989,15 @@ public:
ret->finalize();
return ret;
}
+ StringNew*
+ makeStringNew(StringNewOp op, Expression* ptr, Expression* length) {
+ auto* ret = wasm.allocator.alloc<StringNew>();
+ ret->op = op;
+ ret->ptr = ptr;
+ ret->length = length;
+ ret->finalize();
+ return ret;
+ }
// Additional helpers