diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-18 10:50:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 10:50:54 -0700 |
commit | b9698cc7076390ae2bb937537850395ae7bad056 (patch) | |
tree | a7048c7c9b01e57b6c64d1b0e8a06ad103c674da /src/passes/pass.cpp | |
parent | c3d2775402d74a920577ed317930f3693305354f (diff) | |
download | binaryen-b9698cc7076390ae2bb937537850395ae7bad056.tar.gz binaryen-b9698cc7076390ae2bb937537850395ae7bad056.tar.bz2 binaryen-b9698cc7076390ae2bb937537850395ae7bad056.zip |
Pass options (#788)
* add PassOptions structure, and use it for new -Os param to wasm-opt
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 284bb1642..3ae0819ea 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -124,7 +124,7 @@ void PassRunner::addDefaultGlobalOptimizationPasses() { } void PassRunner::run() { - if (debug) { + if (options.debug) { // for debug logging purposes, run each pass in full before running the other auto totalTime = std::chrono::duration<double>(0); size_t padding = 0; @@ -159,7 +159,7 @@ void PassRunner::run() { totalTime += diff; // validate, ignoring the time std::cerr << "[PassRunner] (validating)\n"; - if (!WasmValidator().validate(*wasm, false, validateGlobally)) { + if (!WasmValidator().validate(*wasm, false, options.validateGlobally)) { if (passDebug) { std::cerr << "Last pass (" << pass->name << ") broke validation. Here is the module before: \n" << moduleBefore.str() << "\n"; } else { @@ -171,7 +171,7 @@ void PassRunner::run() { std::cerr << "[PassRunner] passes took " << totalTime.count() << " seconds." << std::endl; // validate std::cerr << "[PassRunner] (final validation)\n"; - if (!WasmValidator().validate(*wasm, false, validateGlobally)) { + if (!WasmValidator().validate(*wasm, false, options.validateGlobally)) { std::cerr << "final module does not validate\n"; abort(); } @@ -222,7 +222,7 @@ void PassRunner::run() { } void PassRunner::runFunction(Function* func) { - if (debug) { + if (options.debug) { std::cerr << "[PassRunner] running passes on function " << func->name << std::endl; } for (auto* pass : passes) { |