aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index c1082a0028..b459246c29 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/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;
}
}