diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
commit | 793c6b80d3e322c3fefb3c7314b054c7880d1691 (patch) | |
tree | c2d24f4cc875a6e1bf9bf3b3227464448850666f /lib/Transforms/Scalar/IndVarSimplify.cpp | |
parent | 9c9be48b8396e7244e47d2af8890da8eec71c72d (diff) |
Convert xforms over to new pass structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 35844cadb6..48faffebf4 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -8,7 +8,6 @@ #include "llvm/Transforms/Scalar/IndVarSimplify.h" #include "llvm/Analysis/InductionVariable.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/Analysis/Dominators.h" #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/Type.h" @@ -185,14 +184,21 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) { return Changed; } -bool InductionVariableSimplify::doit(Method *M) { +bool InductionVariableSimplify::doit(Method *M, cfg::LoopInfo &Loops) { if (M->isExternal()) return false; - // Figure out the loop structure of the method... - cfg::LoopInfo Loops(M); - // Induction Variables live in the header nodes of the loops of the method... return reduce_apply_bool(Loops.getTopLevelLoops().begin(), Loops.getTopLevelLoops().end(), std::bind1st(std::ptr_fun(TransformLoop), &Loops)); } + +bool InductionVariableSimplify::runOnMethod(Method *M) { + return doit(M, getAnalysis<cfg::LoopInfo>()); +} + +void InductionVariableSimplify::getAnalysisUsageInfo(Pass::AnalysisSet &Req, + Pass::AnalysisSet &Dest, + Pass::AnalysisSet &Prov) { + Req.push_back(cfg::LoopInfo::ID); +} |