diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index a3880255313..40ee5c7f83d 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -188,7 +188,7 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) { } static bool doit(Function *M, cfg::LoopInfo &Loops) { - // Induction Variables live in the header nodes of the loops of the method... + // Induction Variables live in the header nodes of the loops of the function return reduce_apply_bool(Loops.getTopLevelLoops().begin(), Loops.getTopLevelLoops().end(), std::bind1st(std::ptr_fun(TransformLoop), &Loops)); @@ -196,15 +196,13 @@ static bool doit(Function *M, cfg::LoopInfo &Loops) { namespace { - struct InductionVariableSimplify : public MethodPass { - virtual bool runOnMethod(Function *F) { + struct InductionVariableSimplify : public FunctionPass { + virtual bool runOnFunction(Function *F) { return doit(F, getAnalysis<cfg::LoopInfo>()); } - virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Required, - Pass::AnalysisSet &Destroyed, - Pass::AnalysisSet &Provided) { - Required.push_back(cfg::LoopInfo::ID); + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(cfg::LoopInfo::ID); } }; } |