summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm2asm-main.cpp10
-rw-r--r--src/wasm2asm.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/wasm2asm-main.cpp b/src/wasm2asm-main.cpp
index d67bf7a6a..ece78361d 100644
--- a/src/wasm2asm-main.cpp
+++ b/src/wasm2asm-main.cpp
@@ -3,6 +3,7 @@
//
#include "wasm2asm.h"
+#include "wasm-s-parser.h"
using namespace cashew;
using namespace wasm;
@@ -31,18 +32,17 @@ int main(int argc, char **argv) {
fclose(f);
input[num] = 0;
+ if (debug) std::cerr << "s-parsing...\n";
SExpressionParser parser(input);
Element& root = *parser.root;
+
+ if (debug) std::cerr << "w-parsing...\n";
AllocatingModule wasm;
SExpressionWasmBuilder builder(wasm, *root[0], [&]() { abort(); });
- if (debug) std::cerr << "parsing...\n";
- cashew::Parser<Ref, DotZeroValueBuilder> builder;
- Ref asmjs = builder.parseToplevel(input);
-
if (debug) std::cerr << "asming...\n";
Wasm2AsmBuilder wasm2asm;
- Ref asmjs = wasm2asm.processWasm(wasm);
+ Ref asmjs = wasm2asm.processWasm(&wasm);
if (debug) std::cerr << "printing...\n";
asmjs->stringify(std::cout);
diff --git a/src/wasm2asm.h b/src/wasm2asm.h
index 1a4e5fce1..023ee2f18 100644
--- a/src/wasm2asm.h
+++ b/src/wasm2asm.h
@@ -327,7 +327,7 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) {
Ref visit(Expression* curr, IString nextResult) {
IString old = result;
result = nextResult;
- Ref ret = visit(curr);
+ Ref ret = WasmVisitor::visit(curr);
result = old; // keep it consistent for the rest of this frame, which may call visit on multiple children
return ret;
}