@@ -138,16 +138,6 @@ void CallGraph::print(raw_ostream &OS) const {
138138LLVM_DUMP_METHOD void CallGraph::dump () const { print (dbgs ()); }
139139#endif
140140
141- void CallGraph::ReplaceExternalCallEdge (CallGraphNode *Old,
142- CallGraphNode *New) {
143- for (auto &CR : ExternalCallingNode->CalledFunctions )
144- if (CR.second == Old) {
145- CR.second ->DropRef ();
146- CR.second = New;
147- CR.second ->AddRef ();
148- }
149- }
150-
151141// removeFunctionFromModule - Unlink the function from this module, returning
152142// it. Because this removes the function from the module, the call graph node
153143// is destroyed. This is only valid if the function does not call any other
@@ -203,39 +193,6 @@ void CallGraphNode::print(raw_ostream &OS) const {
203193LLVM_DUMP_METHOD void CallGraphNode::dump () const { print (dbgs ()); }
204194#endif
205195
206- // / removeCallEdgeFor - This method removes the edge in the node for the
207- // / specified call site. Note that this method takes linear time, so it
208- // / should be used sparingly.
209- void CallGraphNode::removeCallEdgeFor (CallBase &Call) {
210- for (CalledFunctionsVector::iterator I = CalledFunctions.begin (); ; ++I) {
211- assert (I != CalledFunctions.end () && " Cannot find callsite to remove!" );
212- if (I->first && *I->first == &Call) {
213- I->second ->DropRef ();
214- *I = CalledFunctions.back ();
215- CalledFunctions.pop_back ();
216-
217- // Remove all references to callback functions if there are any.
218- forEachCallbackFunction (Call, [=](Function *CB) {
219- removeOneAbstractEdgeTo (CG->getOrInsertFunction (CB));
220- });
221- return ;
222- }
223- }
224- }
225-
226- // removeAnyCallEdgeTo - This method removes any call edges from this node to
227- // the specified callee function. This takes more time to execute than
228- // removeCallEdgeTo, so it should not be used unless necessary.
229- void CallGraphNode::removeAnyCallEdgeTo (CallGraphNode *Callee) {
230- for (unsigned i = 0 , e = CalledFunctions.size (); i != e; ++i)
231- if (CalledFunctions[i].second == Callee) {
232- Callee->DropRef ();
233- CalledFunctions[i] = CalledFunctions.back ();
234- CalledFunctions.pop_back ();
235- --i; --e;
236- }
237- }
238-
239196// / removeOneAbstractEdgeTo - Remove one edge associated with a null callsite
240197// / from this node to the specified callee function.
241198void CallGraphNode::removeOneAbstractEdgeTo (CallGraphNode *Callee) {
0 commit comments