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.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 8c50ff2dc..0bbc8eebc 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -40,7 +40,7 @@ public:
Builder(MixedArena& allocator) : allocator(allocator) {}
Builder(Module& wasm) : allocator(wasm.allocator) {}
- // make* functions, create nodes
+ // make* functions, other globals
Function* makeFunction(Name name,
std::vector<Type>&& params,
@@ -80,6 +80,16 @@ public:
return func;
}
+ Export* makeExport(Name name, Name value, ExternalKind kind) {
+ auto* export_ = new Export();
+ export_->name = name;
+ export_->value = value;
+ export_->kind = ExternalKind::Function;
+ return export_;
+ }
+
+ // IR nodes
+
Nop* makeNop() {
return allocator.alloc<Nop>();
}