diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
commit | 2fbfdcffd3e0cf41422aaa6c526c37cb02b81341 (patch) | |
tree | c1991eac5d23807b38e5909f861609b243562f70 /lib/Transforms/Instrumentation/ProfilePaths | |
parent | dcc6d4cada290857ee74164816ec3c502c1db7a4 (diff) | |
download | external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.zip external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.gz external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.bz2 |
Change references to the Method class to be references to the Function
class. The Method class is obsolete (renamed) and all references to it
are being converted over to Function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilePaths')
-rw-r--r-- | lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index 1be6458f..aa2cfdd 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -1,8 +1,8 @@ //===-- ProfilePaths.cpp - interface to insert instrumentation ---*- C++ -*--=// // // This inserts intrumentation for counting -// execution of paths though a given method -// Its implemented as a "Method" Pass, and called using opt +// execution of paths though a given function +// Its implemented as a "Function" Pass, and called using opt // // This pass is implemented by using algorithms similar to // 1."Efficient Path Profiling": Ball, T. and Larus, J. R., @@ -18,7 +18,7 @@ // (code inserted through EdgeCode.cpp). // // The algorithm inserts code such that every acyclic path in the CFG -// of a method is identified through a unique number. the code insertion +// of a function is identified through a unique number. the code insertion // is optimal in the sense that its inserted over a minimal set of edges. Also, // the algorithm makes sure than initialization, path increment and counter // update can be collapsed into minmimum number of edges. @@ -27,7 +27,7 @@ #include "llvm/Transforms/Instrumentation/ProfilePaths.h" #include "llvm/Transforms/UnifyMethodExitNodes.h" #include "llvm/Support/CFG.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/BasicBlock.h" #include "llvm/ConstantVals.h" #include "llvm/DerivedTypes.h" @@ -39,10 +39,10 @@ using std::vector; class ProfilePaths: public MethodPass { public: - bool runOnMethod(Method *M); + bool runOnMethod(Function *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 + // entry and only one exit node for the function in the CFG of the function // void ProfilePaths::getAnalysisUsageInfo(Pass::AnalysisSet &Requires, Pass::AnalysisSet &Destroyed, @@ -67,8 +67,8 @@ static Node *findBB(std::set<Node *> &st, BasicBlock *BB){ return NULL; } -//Per method pass for inserting counters and trigger code -bool ProfilePaths::runOnMethod(Method *M){ +//Per function pass for inserting counters and trigger code +bool ProfilePaths::runOnMethod(Function *M){ //Transform the cfg s.t. we have just one exit node BasicBlock *ExitNode = getAnalysis<UnifyMethodExitNodes>().getExitNode(); @@ -83,7 +83,7 @@ bool ProfilePaths::runOnMethod(Method *M){ //That is, no two nodes must hav same BB* //First enter just nodes: later enter edges - for (Method::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ + for (Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ Node *nd=new Node(*BB); nodes.insert(nd); if(*BB==ExitNode) @@ -93,7 +93,7 @@ bool ProfilePaths::runOnMethod(Method *M){ } //now do it againto insert edges - for (Method::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ + for (Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ Node *nd=findBB(nodes, *BB); assert(nd && "No node for this edge!"); for(BasicBlock::succ_iterator s=succ_begin(*BB), se=succ_end(*BB); @@ -165,5 +165,5 @@ bool ProfilePaths::runOnMethod(Method *M){ processGraph(g, rVar, countVar, be, stDummy, exDummy); } - return true; // Always modifies method + return true; // Always modifies function } |