aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-18 21:34:34 +0000
committerChris Lattner <sabre@nondot.org>2004-09-18 21:34:34 +0000
commitcd382a3725e46a41c6dfb923cd1ee295fa0461aa (patch)
treeb45c52e03b6f78ff682c4f454c040cdf65617543
parent111a3484359f66090acf8ea3d5a74583c0a75349 (diff)
downloadexternal_llvm-cd382a3725e46a41c6dfb923cd1ee295fa0461aa.zip
external_llvm-cd382a3725e46a41c6dfb923cd1ee295fa0461aa.tar.gz
external_llvm-cd382a3725e46a41c6dfb923cd1ee295fa0461aa.tar.bz2
Add CallGraphNode::removeAnyCallEdgeTo method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16398 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/CallGraph.h5
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp12
2 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index 4b4db6b..8f2c302 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -251,6 +251,11 @@ public:
/// used sparingly.
void removeCallEdgeTo(CallGraphNode *Callee);
+ /// 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.
+ void removeAnyCallEdgeTo(CallGraphNode *Callee);
+
private: // Stuff to construct the node, used by CallGraph
friend class CallGraph;
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index ac926dc..e3a6024 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -206,3 +206,15 @@ void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {
}
}
}
+
+// 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.
+void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) {
+ for (std::vector<CallGraphNode*>::iterator I = CalledFunctions.begin(),
+ E = CalledFunctions.end(); I != E; ++I)
+ if (*I == Callee) {
+ CalledFunctions.erase(I);
+ E = CalledFunctions.end();
+ }
+}