diff options
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index cb7c5e745..2093b9419 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -893,6 +893,21 @@ public: ret->finalize(); return ret; } + StructNew* makeStructNew(HeapType type, + std::initializer_list<Expression*> args) { + auto* ret = wasm.allocator.alloc<StructNew>(); + ret->operands.set(args); + ret->type = Type(type, NonNullable); + ret->finalize(); + return ret; + } + StructNew* makeStructNew(HeapType type, ExpressionList&& args) { + auto* ret = wasm.allocator.alloc<StructNew>(); + ret->operands = std::move(args); + ret->type = Type(type, NonNullable); + ret->finalize(); + return ret; + } template<typename T> StructNew* makeStructNew(HeapType type, const T& args) { auto* ret = wasm.allocator.alloc<StructNew>(); ret->operands.set(args); |