diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-18 14:09:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-18 14:09:15 -0700 |
commit | cd87eb847378d038342a8e9b73960e74352d29ed (patch) | |
tree | e1a04607c372006c5daa78e6c750d7b57d4196a2 /src/asm2wasm.h | |
parent | a3312f5f2390bf3fe515c99d29d22dff201eeaf9 (diff) | |
parent | ac74a808876a27f44a0eb66cef7cb441be1c2017 (diff) | |
download | binaryen-cd87eb847378d038342a8e9b73960e74352d29ed.tar.gz binaryen-cd87eb847378d038342a8e9b73960e74352d29ed.tar.bz2 binaryen-cd87eb847378d038342a8e9b73960e74352d29ed.zip |
Merge pull request #256 from WebAssembly/debug
Make --debug a boolean
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index c4f73b57a..2d024665e 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -150,7 +150,7 @@ class Asm2WasmBuilder { std::map<CallIndirect*, IString> callIndirects; // track these, as we need to fix them after we know the functionTableStarts. this maps call => its function table bool memoryGrowth; - int debug; + bool debug; public: std::map<IString, MappedGlobal> mappedGlobals; @@ -254,7 +254,7 @@ private: } public: - Asm2WasmBuilder(AllocatingModule& wasm, bool memoryGrowth, int debug) + Asm2WasmBuilder(AllocatingModule& wasm, bool memoryGrowth, bool debug) : wasm(wasm), allocator(wasm.allocator), nextGlobal(8), @@ -729,10 +729,8 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { if (debug) { std::cout << "\nfunc: " << ast[1]->getIString().str << '\n'; - if (debug >= 2) { - ast->stringify(std::cout); - std::cout << '\n'; - } + ast->stringify(std::cout); + std::cout << '\n'; } auto function = allocator.alloc<Function>(); @@ -802,7 +800,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { std::function<Expression* (Ref)> process = [&](Ref ast) -> Expression* { AstStackHelper astStackHelper(ast); // TODO: only create one when we need it? - if (debug >= 2) { + if (debug) { std::cout << "at: "; ast->stringify(std::cout); std::cout << '\n'; |