add a new CallGraphNode::removeCallEdgeFor method, tidy some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-04-13 19:41:25 +00:00
parent f99b286154
commit 75caee2419
2 changed files with 24 additions and 5 deletions

View File

@@ -293,6 +293,20 @@ void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {
}
}
/// removeCallEdgeFor - This method removes the edge in the node for the
/// 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 callee to remove!");
if (CalledFunctions[i-1].first == CS) {
CalledFunctions.erase(CalledFunctions.begin()+i-1);
return;
}
}
}
// removeAnyCallEdgeTo - This method removes any call edges from this node to
// the specified callee function. This takes more time to execute than
// removeCallEdgeTo, so it should not be used unless necessary.