summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-19 09:49:38 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:55:03 -0700
commit266e922cddf0a5c78ed22f046eeebc053a9305c0 (patch)
tree2dec707b00304b1a6c888efb8f2c1b9a19ce38f3 /src/passes/Print.cpp
parent9660c200eff60c10266a85aae0637b495c4cba39 (diff)
downloadbinaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.tar.gz
binaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.tar.bz2
binaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.zip
use globals in asm2wasm
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index fcd155650..fe125234d 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -531,6 +531,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitImport(Import *curr) {
printOpening(o, "import ");
+ printName(curr->name) << ' ';
switch (curr->kind) {
case Export::Function: break;
case Export::Table: o << "table "; break;
@@ -538,14 +539,13 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
case Export::Global: o << "global "; break;
default: WASM_UNREACHABLE();
}
- printName(curr->name) << ' ';
printText(o, curr->module.str) << ' ';
printText(o, curr->base.str);
switch (curr->kind) {
case Export::Function: if (curr->functionType) visitFunctionType(curr->functionType); break;
case Export::Table: break;
case Export::Memory: break;
- case Export::Global: o << printWasmType(curr->globalType); break;
+ case Export::Global: o << ' ' << printWasmType(curr->globalType); break;
default: WASM_UNREACHABLE();
}
o << ')';
@@ -564,7 +564,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitGlobal(Global *curr) {
printOpening(o, "global ");
- printName(curr->name) << ' ' << printWasmType(curr->type);
+ printName(curr->name) << ' ' << printWasmType(curr->type) << ' ';
visit(curr->init);
o << ')';
}