summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 5d4c90840..0dc3e41b1 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -79,8 +79,18 @@ public:
ret->finalize();
return ret;
}
- // Loop
- // Break
+ Loop* makeLoop(Name out, Name in, Expression* body) {
+ auto* ret = allocator.alloc<Loop>();
+ ret->out = out; ret->in = in; ret->body = body;
+ ret->finalize();
+ return ret;
+ }
+ Break* makeBreak(Name name, Expression* value=nullptr, Expression* condition=nullptr) {
+ auto* ret = allocator.alloc<Break>();
+ ret->name = name; ret->value = value; ret->condition = condition;
+ ret->finalize();
+ return ret;
+ }
// Switch
// CallBase
// Call