summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-11 20:40:55 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-11 20:58:53 -0800
commit686a8334090f57e1ba218e552819b3c6374059b5 (patch)
treef5dd8b43127fda4671eb4c7ce93440995525744e /src/wasm.h
parentefe369358fd6c8ede5145f12bfa511b515d2a32a (diff)
downloadbinaryen-686a8334090f57e1ba218e552819b3c6374059b5.tar.gz
binaryen-686a8334090f57e1ba218e552819b3c6374059b5.tar.bz2
binaryen-686a8334090f57e1ba218e552819b3c6374059b5.zip
refactor FunctionType to always be accessed from the Module's central store, which is necessary for simple binary writing
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index c4654580a..306804c66 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -540,6 +540,8 @@ public:
WasmType result;
std::vector<WasmType> params;
+ FunctionType() : result(none) {}
+
std::ostream& print(std::ostream &o, unsigned indent, bool full=false) {
if (full) {
printOpening(o, "type") << ' ' << name << " (func";
@@ -938,13 +940,15 @@ public:
class Import {
public:
Name name, module, base; // name = module.base
- FunctionType type;
+ FunctionType* type;
+
+ Import() : type(nullptr) {}
std::ostream& print(std::ostream &o, unsigned indent) {
printOpening(o, "import ") << name << ' ';
printText(o, module.str) << ' ';
printText(o, base.str);
- type.print(o, indent);
+ if (type) type->print(o, indent);
return o << ')';
}
};