diff options
author | JF Bastien <github@jfbastien.com> | 2016-02-05 11:23:11 +0100 |
---|---|---|
committer | JF Bastien <github@jfbastien.com> | 2016-02-05 11:23:11 +0100 |
commit | 8f67b6e27a38c93fbca7f3c44a88889b3896952f (patch) | |
tree | 7f8fc703d206af8044ab794e2ae340387134c7f9 /src/wasm.h | |
parent | c1f9026c2788e4ef6f6af0c6d9aa04d22fc00320 (diff) | |
parent | 31409184708b04bae830869c7b6ce61726020444 (diff) | |
download | binaryen-8f67b6e27a38c93fbca7f3c44a88889b3896952f.tar.gz binaryen-8f67b6e27a38c93fbca7f3c44a88889b3896952f.tar.bz2 binaryen-8f67b6e27a38c93fbca7f3c44a88889b3896952f.zip |
Merge pull request #182 from WebAssembly/start
Support start
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h index c030d9d60..b9d0d6822 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1125,6 +1125,7 @@ public: std::map<Name, Function*> functionsMap; Table table; Memory memory; + Name start; Module() : functionTypeIndex(0), importIndex(0), exportIndex(0), functionIndex(0) {} @@ -1168,6 +1169,9 @@ public: functionsMap[numericName] = curr; functionIndex++; } + void addStart(const Name &s) { + start = s; + } void removeImport(Name name) { for (size_t i = 0; i < imports.size(); i++) { @@ -1211,6 +1215,10 @@ public: o << "\")"; } o << (module.memory.segments.size() > 0 ? "\n " : "") << ")\n"; + if (module.start.is()) { + doIndent(o, indent); + printOpening(o, "start") << " " << module.start << ")\n"; + } for (auto& curr : module.functionTypes) { doIndent(o, indent); curr->print(o, indent, true); |