diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 11:47:54 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 11:47:54 -0700 |
commit | bb3dbb2784e91a517916f366e710e01a2e7331f6 (patch) | |
tree | 08ee1e92384235c2f830b65ba7a12c59689d1b88 /src/pass.h | |
parent | f85e310924535da09822f3d43aeee9265eb12760 (diff) | |
parent | bbf846554a407e0385f91f5b7eeb9594c12e0bc5 (diff) | |
download | binaryen-bb3dbb2784e91a517916f366e710e01a2e7331f6.tar.gz binaryen-bb3dbb2784e91a517916f366e710e01a2e7331f6.tar.bz2 binaryen-bb3dbb2784e91a517916f366e710e01a2e7331f6.zip |
Merge pull request #435 from WebAssembly/more-relooper
Add optimization to C API, and with that, more relooper tests
Diffstat (limited to 'src/pass.h')
-rw-r--r-- | src/pass.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pass.h b/src/pass.h index 85aec624f..bfbcb26d8 100644 --- a/src/pass.h +++ b/src/pass.h @@ -22,6 +22,7 @@ #include "wasm.h" #include "wasm-traversal.h" #include "mixed_arena.h" +#include "support/utilities.h" namespace wasm { @@ -66,18 +67,19 @@ struct RegisterPass { // Runs a set of passes, in order // struct PassRunner { + Module* wasm; MixedArena* allocator; std::vector<Pass*> passes; Pass* currPass; bool debug = false; - PassRunner(MixedArena* allocator) : allocator(allocator) {} + PassRunner(Module* wasm) : wasm(wasm), allocator(&wasm->allocator) {} void setDebug(bool debug_) { debug = debug_; } void add(std::string passName) { auto pass = PassRegistry::get()->createPass(passName); - assert(pass); + if (!pass) Fatal() << "Could not find pass: " << passName << "\n"; passes.push_back(pass); } @@ -95,7 +97,7 @@ struct PassRunner { // what -O does. void addDefaultOptimizationPasses(); - void run(Module* module); + void run(); // Get the last pass that was already executed of a certain type. template<class P> |