* 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/Instrumentation/ProfilePaths/ProfilePaths.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
index aa2cfdd..860119e 100644
--- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
@@ -37,17 +37,15 @@
using std::vector;
-class ProfilePaths: public MethodPass {
+class ProfilePaths: public FunctionPass {
public:
- bool runOnMethod(Function *M);
+ bool runOnFunction(Function *F);
// Before this pass, make sure that there is only one
// entry and only one exit node for the function in the CFG of the function
//
- void ProfilePaths::getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
- Pass::AnalysisSet &Destroyed,
- Pass::AnalysisSet &Provided) {
- Requires.push_back(UnifyMethodExitNodes::ID);
+ void ProfilePaths::getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired(UnifyMethodExitNodes::ID);
}
};
@@ -68,7 +66,7 @@
}
//Per function pass for inserting counters and trigger code
-bool ProfilePaths::runOnMethod(Function *M){
+bool ProfilePaths::runOnFunction(Function *M){
//Transform the cfg s.t. we have just one exit node
BasicBlock *ExitNode =
getAnalysis<UnifyMethodExitNodes>().getExitNode();