diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-02-26 21:46:54 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-02-26 21:46:54 +0000 |
| commit | 04805fa29cfed84fd748ff2f97da3968282ee3b1 (patch) | |
| tree | 7f2bfbac67628f247c8929af9f6a6e352936e7d5 /llvm/lib/Transforms/Scalar/ADCE.cpp | |
| parent | b67f732b8cc2e1817a1318d596a9665d5c5c5057 (diff) | |
| download | bcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.tar.gz bcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.zip | |
Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it.
llvm-svn: 1816
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ADCE.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 91bed41f6c3..14c68f410e1 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -288,21 +288,24 @@ BasicBlock *ADCE::fixupCFG(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks, } } - - -// doADCE - Execute the Agressive Dead Code Elimination Algorithm -// -bool AgressiveDCE::runOnMethod(Method *M) { - return ADCE(M).doADCE( - getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID)); +namespace { + struct AgressiveDCE : public MethodPass { + // doADCE - Execute the Agressive Dead Code Elimination Algorithm + // + virtual bool runOnMethod(Method *M) { + return ADCE(M).doADCE( + getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID)); + } + // getAnalysisUsageInfo - We require post dominance frontiers (aka Control + // Dependence Graph) + virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires, + Pass::AnalysisSet &Destroyed, + Pass::AnalysisSet &Provided) { + Requires.push_back(cfg::DominanceFrontier::PostDomID); + } + }; } - -// getAnalysisUsageInfo - We require post dominance frontiers (aka Control -// Dependence Graph) -// -void AgressiveDCE::getAnalysisUsageInfo(Pass::AnalysisSet &Requires, - Pass::AnalysisSet &Destroyed, - Pass::AnalysisSet &Provided) { - Requires.push_back(cfg::DominanceFrontier::PostDomID); +Pass *createAgressiveDCEPass() { + return new AgressiveDCE(); } |

