aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-01-17 19:46:01 +0000
committerGabor Greif <ggreif@gmail.com>2009-01-17 19:46:01 +0000
commita3ef1556c85ddd980912292a7d784ae23afcb1d7 (patch)
treed4fde9a5b506993a853d6c1d8f1ff7730221c80c /lib/Analysis/IPA
parent75c4be746eb404d012c2c272c1bbfc0315a21693 (diff)
downloadexternal_llvm-a3ef1556c85ddd980912292a7d784ae23afcb1d7.zip
external_llvm-a3ef1556c85ddd980912292a7d784ae23afcb1d7.tar.gz
external_llvm-a3ef1556c85ddd980912292a7d784ae23afcb1d7.tar.bz2
switch over some other methods from indices to iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index b459246..c8f1d92 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/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;
}
}