[Analysis] Remove unused functions in CallGraphNode (#127411)
The last uses of these functions were removed in:
commit 58bc98cd3a
Author: Arthur Eubanks <aeubanks@google.com>
Date: Fri Jul 12 10:02:50 2024 -0700
This commit is contained in:
@@ -129,10 +129,6 @@ public:
|
||||
return CallsExternalNode.get();
|
||||
}
|
||||
|
||||
/// Old node has been deleted, and New is to be used in its place, update the
|
||||
/// ExternalCallingNode.
|
||||
void ReplaceExternalCallEdge(CallGraphNode *Old, CallGraphNode *New);
|
||||
|
||||
//===---------------------------------------------------------------------
|
||||
// Functions to keep a call graph up to date with a function that has been
|
||||
// modified.
|
||||
@@ -251,18 +247,6 @@ public:
|
||||
CalledFunctions.pop_back();
|
||||
}
|
||||
|
||||
/// 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 removeCallEdgeFor(CallBase &Call);
|
||||
|
||||
/// Removes all 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);
|
||||
|
||||
/// Removes one edge associated with a null callsite from this node to
|
||||
/// the specified callee function.
|
||||
void removeOneAbstractEdgeTo(CallGraphNode *Callee);
|
||||
|
||||
@@ -138,16 +138,6 @@ void CallGraph::print(raw_ostream &OS) const {
|
||||
LLVM_DUMP_METHOD void CallGraph::dump() const { print(dbgs()); }
|
||||
#endif
|
||||
|
||||
void CallGraph::ReplaceExternalCallEdge(CallGraphNode *Old,
|
||||
CallGraphNode *New) {
|
||||
for (auto &CR : ExternalCallingNode->CalledFunctions)
|
||||
if (CR.second == Old) {
|
||||
CR.second->DropRef();
|
||||
CR.second = New;
|
||||
CR.second->AddRef();
|
||||
}
|
||||
}
|
||||
|
||||
// removeFunctionFromModule - Unlink the function from this module, returning
|
||||
// it. Because this removes the function from the module, the call graph node
|
||||
// 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 {
|
||||
LLVM_DUMP_METHOD void CallGraphNode::dump() const { print(dbgs()); }
|
||||
#endif
|
||||
|
||||
/// 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(CallBase &Call) {
|
||||
for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) {
|
||||
assert(I != CalledFunctions.end() && "Cannot find callsite to remove!");
|
||||
if (I->first && *I->first == &Call) {
|
||||
I->second->DropRef();
|
||||
*I = CalledFunctions.back();
|
||||
CalledFunctions.pop_back();
|
||||
|
||||
// Remove all references to callback functions if there are any.
|
||||
forEachCallbackFunction(Call, [=](Function *CB) {
|
||||
removeOneAbstractEdgeTo(CG->getOrInsertFunction(CB));
|
||||
});
|
||||
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.
|
||||
void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) {
|
||||
for (unsigned i = 0, e = CalledFunctions.size(); i != e; ++i)
|
||||
if (CalledFunctions[i].second == Callee) {
|
||||
Callee->DropRef();
|
||||
CalledFunctions[i] = CalledFunctions.back();
|
||||
CalledFunctions.pop_back();
|
||||
--i; --e;
|
||||
}
|
||||
}
|
||||
|
||||
/// removeOneAbstractEdgeTo - Remove one edge associated with a null callsite
|
||||
/// from this node to the specified callee function.
|
||||
void CallGraphNode::removeOneAbstractEdgeTo(CallGraphNode *Callee) {
|
||||
|
||||
Reference in New Issue
Block a user