Skip to content

Commit f646dbd

Browse files
committed
get wasm2asm to start printing
1 parent 0b46869 commit f646dbd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/wasm2asm-main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@ int main(int argc, char **argv) {
4444
Wasm2AsmBuilder wasm2asm;
4545
Ref asmjs = wasm2asm.processWasm(&wasm);
4646

47-
if (debug) std::cerr << "printing...\n";
47+
if (debug) std::cerr << "a-printing...\n";
4848
asmjs->stringify(std::cout);
4949
std::cout << '\n';
5050

51+
if (debug) std::cerr << "j-printing...\n";
52+
JSPrinter jser(true, true, asmjs);
53+
jser.printAst();
54+
std::cout << jser.buffer << "\n";
55+
5156
if (debug) std::cerr << "done.\n";
5257
}
5358

src/wasm2asm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class Wasm2AsmBuilder {
132132
Ref Wasm2AsmBuilder::processWasm(Module* wasm) {
133133
Ref ret = ValueBuilder::makeToplevel();
134134
Ref asmFunc = ValueBuilder::makeFunction(ASM_FUNC);
135+
ret[1]->push_back(asmFunc);
135136
// imports XXX
136137
// exports XXX
137138
// functions

0 commit comments

Comments
 (0)