forked from OSchip/llvm-project
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
This commit is contained in:
parent
f1abfdccdc
commit
1c6549db6f
|
@ -260,10 +260,10 @@ void CallGraphNode::dump() const { print(cerr); }
|
||||||
/// specified call site. Note that this method takes linear time, so it
|
/// specified call site. Note that this method takes linear time, so it
|
||||||
/// should be used sparingly.
|
/// should be used sparingly.
|
||||||
void CallGraphNode::removeCallEdgeFor(CallSite CS) {
|
void CallGraphNode::removeCallEdgeFor(CallSite CS) {
|
||||||
for (unsigned i = CalledFunctions.size(); ; --i) {
|
for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) {
|
||||||
assert(i && "Cannot find callsite to remove!");
|
assert(I != CalledFunctions.end() && "Cannot find callsite to remove!");
|
||||||
if (CalledFunctions[i-1].first == CS) {
|
if (I->first == CS) {
|
||||||
CalledFunctions.erase(CalledFunctions.begin()+i-1);
|
CalledFunctions.erase(I);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue