diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-01-17 19:46:01 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-01-17 19:46:01 +0000 |
commit | 20b722fe1c0c736c69879317cc109cdc981e527d (patch) | |
tree | ab2be58f64afa3c12dec0b055491231adc1eb035 /llvm/lib/Analysis/IPA/CallGraph.cpp | |
parent | 705c6d9cdd035745a603bc49ae81b0e208122259 (diff) | |
download | bcm5719-llvm-20b722fe1c0c736c69879317cc109cdc981e527d.tar.gz bcm5719-llvm-20b722fe1c0c736c69879317cc109cdc981e527d.zip |
switch over some other methods from indices to iterators
llvm-svn: 62430
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index b459246c298..c8f1d920658 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -285,11 +285,11 @@ void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) { /// removeOneAbstractEdgeTo - Remove one edge associated with a null callsite /// from this node to the specified callee function. void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) { - for (unsigned i = CalledFunctions.size(); ; --i) { - assert(i && "Cannot find callee to remove!"); - CallRecord &CR = CalledFunctions[i-1]; + for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) { + assert(I != CalledFunctions.end() && "Cannot find callee to remove!"); + CallRecord &CR = *I; if (CR.second == Callee && !CR.first.getInstruction()) { - CalledFunctions.erase(CalledFunctions.begin()+i-1); + CalledFunctions.erase(I); return; } } @@ -299,10 +299,10 @@ void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) { /// New CallSite instead. Note that this method takes linear time, so it /// should be used sparingly. void CallGraphNode::replaceCallSite(CallSite Old, CallSite New) { - for (unsigned i = CalledFunctions.size(); ; --i) { - assert(i && "Cannot find callsite to replace!"); - if (CalledFunctions[i-1].first == Old) { - CalledFunctions[i-1].first = New; + for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) { + assert(I != CalledFunctions.end() && "Cannot find callsite to replace!"); + if (I->first == Old) { + I->first = New; return; } } |