summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-01-17 00:14:25 +0000
committerGabor Greif <ggreif@gmail.com>2009-01-17 00:14:25 +0000
commit1c6549db6f982a2e916104e077ce353ab4b0fefe (patch)
tree1f6427ce7c2e870418ef938beff567a2b2738009 /llvm/lib/Analysis
parentf1abfdccdcc49e2211ec74d436b8bc534f2affb1 (diff)
downloadbcm5719-llvm-1c6549db6f982a2e916104e077ce353ab4b0fefe.tar.gz
bcm5719-llvm-1c6549db6f982a2e916104e077ce353ab4b0fefe.zip
speed up iterative loop by using iterators. changes direction, but functionally equivalent
if this works out, I'll change the others next. llvm-svn: 62385
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index c1082a00280..b459246c298 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -260,10 +260,10 @@ void CallGraphNode::dump() const { print(cerr); }
/// specified call site. Note that this method takes linear time, so it
/// should be used sparingly.
void CallGraphNode::removeCallEdgeFor(CallSite CS) {
- for (unsigned i = CalledFunctions.size(); ; --i) {
- assert(i && "Cannot find callsite to remove!");
- if (CalledFunctions[i-1].first == CS) {
- CalledFunctions.erase(CalledFunctions.begin()+i-1);
+ for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) {
+ assert(I != CalledFunctions.end() && "Cannot find callsite to remove!");
+ if (I->first == CS) {
+ CalledFunctions.erase(I);
return;
}
}
OpenPOWER on IntegriCloud