summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-13 19:41:25 +0000
committerChris Lattner <sabre@nondot.org>2008-04-13 19:41:25 +0000
commitcc9709cff40ead95fe2497c8b370f2194eedeaed (patch)
treebb390380d5f2878e81fe324d91b1b6733f918f5e /llvm/lib/Analysis/IPA/CallGraph.cpp
parent0e0bbb626d023a2350f19fa3fb7e8e30b0ace095 (diff)
downloadbcm5719-llvm-cc9709cff40ead95fe2497c8b370f2194eedeaed.tar.gz
bcm5719-llvm-cc9709cff40ead95fe2497c8b370f2194eedeaed.zip
add a new CallGraphNode::removeCallEdgeFor method, tidy some comments.
llvm-svn: 49617
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 5c5418ba250..f0dd1880ff4 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud