diff options
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 4a31295a72..5616ee9a4b 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -282,6 +282,16 @@ void CallGraphNode::print(std::ostream &OS) const { void CallGraphNode::dump() const { print(cerr); } +void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { + for (unsigned i = CalledFunctions.size(); ; --i) { + assert(i && "Cannot find callee to remove!"); + if (CalledFunctions[i-1].second == Callee) { + CalledFunctions.erase(CalledFunctions.begin()+i-1); + return; + } + } +} + /// 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. |