summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-06-21 17:11:02 -0700
committerGitHub <noreply@github.com>2016-06-21 17:11:02 -0700
commit463bef3f8afeadb658612896384cc439897533a0 (patch)
treed020ea3189f24d346e86d90f950f214913e4dfaf /src/pass.h
parent52821472b93e551375b8df43cc1b8a7bfc18e8f5 (diff)
parent41689a5dde63c96eb1bf7daf50bc192979aa0452 (diff)
downloadbinaryen-463bef3f8afeadb658612896384cc439897533a0.tar.gz
binaryen-463bef3f8afeadb658612896384cc439897533a0.tar.bz2
binaryen-463bef3f8afeadb658612896384cc439897533a0.zip
Merge pull request #593 from WebAssembly/remove-div0
Explicit registering of passes
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/pass.h b/src/pass.h
index 4a5fe609d..0ad8d8c1d 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -32,6 +32,8 @@ class Pass;
// Global registry of all passes in /passes/
//
struct PassRegistry {
+ PassRegistry();
+
static PassRegistry* get();
typedef std::function<Pass* ()> Creator;
@@ -42,6 +44,8 @@ struct PassRegistry {
std::string getPassDescription(std::string name);
private:
+ void registerPasses();
+
struct PassInfo {
std::string description;
Creator create;
@@ -52,18 +56,6 @@ private:
};
//
-// Utility class to register a pass. See pass files for usage.
-//
-template<class P>
-struct RegisterPass {
- RegisterPass(const char* name, const char *description) {
- PassRegistry::get()->registerPass(name, description, []() {
- return new P();
- });
- }
-};
-
-//
// Runs a set of passes, in order
//
struct PassRunner {