diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-26 20:04:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-26 20:04:59 +0000 |
commit | eded4916d6679a8c42e5f16d022afe0252c2df8e (patch) | |
tree | 9cd3acd6d1bf66eeb5317ebfaa0d872399a51950 /lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp | |
parent | dc9a1f5ce813d7d397726106bb796520c47d20e6 (diff) |
Move ProfilePaths class into ProfilePaths library, only expose a creation function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index 03a3e4bcca..1be6458fea 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -32,10 +32,32 @@ #include "llvm/ConstantVals.h" #include "llvm/DerivedTypes.h" #include "llvm/iMemory.h" +#include "llvm/Pass.h" #include "Graph.h" using std::vector; +class ProfilePaths: public MethodPass { + public: + bool runOnMethod(Method *M); + + // Before this pass, make sure that there is only one + // entry and only one exit node for the method in the CFG of the method + // + void ProfilePaths::getAnalysisUsageInfo(Pass::AnalysisSet &Requires, + Pass::AnalysisSet &Destroyed, + Pass::AnalysisSet &Provided) { + Requires.push_back(UnifyMethodExitNodes::ID); + } +}; + +// createProfilePathsPass - Create a new pass to add path profiling +// +Pass *createProfilePathsPass() { + return new ProfilePaths(); +} + + static Node *findBB(std::set<Node *> &st, BasicBlock *BB){ for(std::set<Node *>::iterator si=st.begin(); si!=st.end(); ++si){ if(((*si)->getElement())==BB){ @@ -145,18 +167,3 @@ bool ProfilePaths::runOnMethod(Method *M){ return true; // Always modifies method } - -//Before this pass, make sure that there is only one -//entry and only one exit node for the method in the CFG of the method -void ProfilePaths::getAnalysisUsageInfo(Pass::AnalysisSet &Requires, - Pass::AnalysisSet &Destroyed, - Pass::AnalysisSet &Provided) { - Requires.push_back(UnifyMethodExitNodes::ID); -} - - - - - - - |