* Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
- Method is now const
- It now takes one AnalysisUsage object to fill in instead of 3 vectors
to fill in
- Pass's now specify which other passes they _preserve_ not which ones
they modify (be conservative!)
- A pass can specify that it preserves all analyses (because it never
modifies the underlying program)
* s/Method/Function/g in other random places as well
llvm-svn: 2333
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index a388025..40ee5c7 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -188,7 +188,7 @@
}
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 @@
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);
}
};
}