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, 13 insertions, 1 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 46ec734cc..bb739af89 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -88,10 +88,22 @@ public:
table->type = type;
table->initial = initial;
table->max = max;
-
return table;
}
+ static std::unique_ptr<ElementSegment>
+ makeElementSegment(Name name,
+ Name table,
+ Expression* offset = nullptr,
+ Type type = Type::funcref) {
+ auto seg = std::make_unique<ElementSegment>();
+ seg->name = name;
+ seg->table = table;
+ seg->offset = offset;
+ seg->type = type;
+ return seg;
+ }
+
static std::unique_ptr<Export>
makeExport(Name name, Name value, ExternalKind kind) {
auto export_ = std::make_unique<Export>();