diff options
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 92206deff..198cb9ab5 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -47,6 +47,13 @@ void PassRegistry::registerPass(const char* name, passInfos[name] = PassInfo(description, create); } +void PassRegistry::registerTestPass(const char* name, + const char* description, + Creator create) { + assert(passInfos.find(name) == passInfos.end()); + passInfos[name] = PassInfo(description, create, true); +} + std::unique_ptr<Pass> PassRegistry::createPass(std::string name) { if (passInfos.find(name) == passInfos.end()) { Fatal() << "Could not find pass: " << name << "\n"; @@ -70,6 +77,11 @@ std::string PassRegistry::getPassDescription(std::string name) { return passInfos[name].description; } +bool PassRegistry::isPassHidden(std::string name) { + assert(passInfos.find(name) != passInfos.end()); + return passInfos[name].hidden; +} + // PassRunner void PassRegistry::registerPasses() { @@ -410,6 +422,11 @@ void PassRegistry::registerPasses() { registerPass("vacuum", "removes obviously unneeded code", createVacuumPass); // registerPass( // "lower-i64", "lowers i64 into pairs of i32s", createLowerInt64Pass); + + // Register passes used for internal testing. These don't show up in --help. + registerTestPass("catch-pop-fixup", + "fixup nested pops within catches", + createCatchPopFixupPass); } void PassRunner::addIfNoDWARFIssues(std::string passName) { |