diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-04-13 19:41:25 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-04-13 19:41:25 +0000 |
| commit | 9125c40e5696955c6e1ece0c31d8f8b972947374 (patch) | |
| tree | 67511ac1c979a76cd4d24804622196256525cc2e /lib | |
| parent | 7f2017de06c4cf480a3136ccda5866a82b180c4b (diff) | |
| download | external_llvm-9125c40e5696955c6e1ece0c31d8f8b972947374.zip external_llvm-9125c40e5696955c6e1ece0c31d8f8b972947374.tar.gz external_llvm-9125c40e5696955c6e1ece0c31d8f8b972947374.tar.bz2 | |
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
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 5c5418b..f0dd188 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -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. |
