diff options
author | Alon Zakai <azakai@google.com> | 2022-07-13 14:38:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 14:38:10 -0700 |
commit | 9671e95adbfcf0984a7e9800a7ea2ed33e1670ad (patch) | |
tree | d7273e64ed26429d18568439cdfb7b1fb6369645 /src/wasm-builder.h | |
parent | 7b9c18b98c020f887aa9cb1750543751ebe5c530 (diff) | |
download | binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.tar.gz binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.tar.bz2 binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.zip |
[Strings] stringview access operations (#4798)
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 9fe039af1..f636ea799 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -1041,6 +1041,38 @@ public: ret->finalize(); return ret; } + StringWTF8Advance* + makeStringWTF8Advance(Expression* ref, Expression* pos, Expression* bytes) { + auto* ret = wasm.allocator.alloc<StringWTF8Advance>(); + ret->ref = ref; + ret->pos = pos; + ret->bytes = bytes; + ret->finalize(); + return ret; + } + StringWTF16Get* makeStringWTF16Get(Expression* ref, Expression* pos) { + auto* ret = wasm.allocator.alloc<StringWTF16Get>(); + ret->ref = ref; + ret->pos = pos; + ret->finalize(); + return ret; + } + StringIterNext* makeStringIterNext(Expression* ref) { + auto* ret = wasm.allocator.alloc<StringIterNext>(); + ret->ref = ref; + ret->finalize(); + return ret; + } + StringIterMove* makeStringIterMove(StringIterMoveOp op, + Expression* ref, + Expression* num = nullptr) { + auto* ret = wasm.allocator.alloc<StringIterMove>(); + ret->op = op; + ret->ref = ref; + ret->num = num; + ret->finalize(); + return ret; + } // Additional helpers |