diff options
author | Thomas Lively <tlively@google.com> | 2024-05-15 12:07:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 12:07:34 -0700 |
commit | 6b43a5ef76149c92e216fddb0a1ee17f736b4b6e (patch) | |
tree | 7b2deb1e6924ba8f74e0b25c26cf2d9a63ad610a /src/wasm-builder.h | |
parent | ef4b57c2a491a2193435dccdc9305f6a79965715 (diff) | |
download | binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.gz binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.bz2 binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.zip |
[Strings] Remove operations not included in imported strings (#6589)
The stringref proposal has been superseded by the imported JS strings proposal,
but the former has many more operations than the latter. To reduce complexity,
remove all operations that are part of stringref but not part of imported
strings.
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 784521c73..8f86b3647 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -1086,28 +1086,15 @@ public: return ret; } StringNew* makeStringNew(StringNewOp op, - Expression* ptr, - Expression* length, - bool try_) { - auto* ret = wasm.allocator.alloc<StringNew>(); - ret->op = op; - ret->ptr = ptr; - ret->length = length; - ret->try_ = try_; - ret->finalize(); - return ret; - } - StringNew* makeStringNew(StringNewOp op, - Expression* ptr, - Expression* start, - Expression* end, - bool try_) { + Expression* ref, + Expression* start = nullptr, + Expression* end = nullptr) { + assert((start && end) != (op == StringNewFromCodePoint)); auto* ret = wasm.allocator.alloc<StringNew>(); ret->op = op; - ret->ptr = ptr; + ret->ref = ref; ret->start = start; ret->end = end; - ret->try_ = try_; ret->finalize(); return ret; } @@ -1125,13 +1112,13 @@ public: return ret; } StringEncode* makeStringEncode(StringEncodeOp op, - Expression* ref, - Expression* ptr, + Expression* str, + Expression* array, Expression* start = nullptr) { auto* ret = wasm.allocator.alloc<StringEncode>(); ret->op = op; - ret->ref = ref; - ret->ptr = ptr; + ret->str = str; + ret->array = array; ret->start = start; ret->finalize(); return ret; |