mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
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
This commit is contained in:
parent
7543f7fae3
commit
7f2e381b56
@ -285,11 +285,11 @@ void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) {
|
|||||||
/// removeOneAbstractEdgeTo - Remove one edge associated with a null callsite
|
/// removeOneAbstractEdgeTo - Remove one edge associated with a null callsite
|
||||||
/// from this node to the specified callee function.
|
/// from this node to the specified callee function.
|
||||||
void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) {
|
void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) {
|
||||||
for (unsigned i = CalledFunctions.size(); ; --i) {
|
for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) {
|
||||||
assert(i && "Cannot find callee to remove!");
|
assert(I != CalledFunctions.end() && "Cannot find callee to remove!");
|
||||||
CallRecord &CR = CalledFunctions[i-1];
|
CallRecord &CR = *I;
|
||||||
if (CR.second == Callee && !CR.first.getInstruction()) {
|
if (CR.second == Callee && !CR.first.getInstruction()) {
|
||||||
CalledFunctions.erase(CalledFunctions.begin()+i-1);
|
CalledFunctions.erase(I);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,10 +299,10 @@ void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) {
|
|||||||
/// New CallSite instead. Note that this method takes linear time, so it
|
/// New CallSite instead. Note that this method takes linear time, so it
|
||||||
/// should be used sparingly.
|
/// should be used sparingly.
|
||||||
void CallGraphNode::replaceCallSite(CallSite Old, CallSite New) {
|
void CallGraphNode::replaceCallSite(CallSite Old, CallSite New) {
|
||||||
for (unsigned i = CalledFunctions.size(); ; --i) {
|
for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) {
|
||||||
assert(i && "Cannot find callsite to replace!");
|
assert(I != CalledFunctions.end() && "Cannot find callsite to replace!");
|
||||||
if (CalledFunctions[i-1].first == Old) {
|
if (I->first == Old) {
|
||||||
CalledFunctions[i-1].first = New;
|
I->first = New;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user