summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-05 11:47:54 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-05 11:47:54 -0700
commitbb3dbb2784e91a517916f366e710e01a2e7331f6 (patch)
tree08ee1e92384235c2f830b65ba7a12c59689d1b88 /src/pass.h
parentf85e310924535da09822f3d43aeee9265eb12760 (diff)
parentbbf846554a407e0385f91f5b7eeb9594c12e0bc5 (diff)
downloadbinaryen-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.h8
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>