diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/binaryen-shell.cpp | 4 | ||||
-rw-r--r-- | src/wasm-as.cpp | 2 | ||||
-rw-r--r-- | src/wasm-s-parser.h | 7 | ||||
-rw-r--r-- | src/wasm2asm-main.cpp | 2 |
4 files changed, 6 insertions, 9 deletions
diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp index 84b81963b..8f99d1295 100644 --- a/src/binaryen-shell.cpp +++ b/src/binaryen-shell.cpp @@ -120,7 +120,7 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm, new SExpressionWasmBuilder(wasm, *curr[1], [&]() { invalid = true; throw ParseException(); - }, false) + }) ); } catch (const ParseException&) { invalid = true; @@ -219,7 +219,7 @@ int main(int argc, const char* argv[]) { if (options.debug) std::cerr << "parsing s-expressions to wasm...\n"; AllocatingModule wasm; std::unique_ptr<SExpressionWasmBuilder> builder( - new SExpressionWasmBuilder(wasm, *root[i], [&]() { abort(); }, options.debug)); + new SExpressionWasmBuilder(wasm, *root[i], [&]() { abort(); })); i++; MixedArena moreModuleAllocations; diff --git a/src/wasm-as.cpp b/src/wasm-as.cpp index 37085a350..c2a8abc6e 100644 --- a/src/wasm-as.cpp +++ b/src/wasm-as.cpp @@ -49,7 +49,7 @@ int main(int argc, const char *argv[]) { if (options.debug) std::cerr << "w-parsing..." << std::endl; AllocatingModule wasm; - SExpressionWasmBuilder builder(wasm, *root[0], [&]() { abort(); }, false); + SExpressionWasmBuilder builder(wasm, *root[0], [&]() { abort(); }); if (options.debug) std::cerr << "binarification..." << std::endl; BufferWithRandomAccess buffer(options.debug); diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 40f2a41a0..cdda00b05 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -242,11 +242,10 @@ class SExpressionWasmBuilder { int functionCounter; int importCounter; std::map<Name, WasmType> functionTypes; // we need to know function return types before we parse their contents - bool debug; public: // Assumes control of and modifies the input. - SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, std::function<void ()> onError, bool debug=false) : wasm(wasm), allocator(wasm.allocator), onError(onError), importCounter(0), debug(debug) { + SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, std::function<void ()> onError) : wasm(wasm), allocator(wasm.allocator), onError(onError), importCounter(0) { assert(module[0]->str() == MODULE); functionCounter = 0; for (unsigned i = 1; i < module.size(); i++) { @@ -260,7 +259,7 @@ public: } // constructor without onError - SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, bool debug=false) : SExpressionWasmBuilder(wasm, module, [&]() { abort(); }, debug) {} + SExpressionWasmBuilder(AllocatingModule& wasm, Element& module) : SExpressionWasmBuilder(wasm, module, [&]() { abort(); }) {} private: @@ -351,7 +350,6 @@ private: // unnamed, use an index func->name = Name::fromInt(functionCounter); } - if (debug) std::cerr << "parse function " << func->name << '\n'; functionCounter++; func->body = nullptr; localIndex = 0; @@ -452,7 +450,6 @@ public: #define abort_on(str) { std::cerr << "aborting on " << str << '\n'; onError(); } Expression* parseExpression(Element& s) { - //if (debug) std::cerr << "parse expression " << s << '\n'; IString id = s[0]->str(); const char *str = id.str; const char *dot = strchr(str, '.'); diff --git a/src/wasm2asm-main.cpp b/src/wasm2asm-main.cpp index d67dc7a88..2234f2343 100644 --- a/src/wasm2asm-main.cpp +++ b/src/wasm2asm-main.cpp @@ -52,7 +52,7 @@ int main(int argc, const char *argv[]) { if (options.debug) std::cerr << "w-parsing..." << std::endl; AllocatingModule wasm; - SExpressionWasmBuilder builder(wasm, *root[0], [&]() { abort(); }, false); + SExpressionWasmBuilder builder(wasm, *root[0], [&]() { abort(); }); if (options.debug) std::cerr << "asming..." << std::endl; Wasm2AsmBuilder wasm2asm(options.debug); |