1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[Analysis] Remove spliceFunction (NFC)

The function was introduced without a user on Jan 3, 2011 in commit
0f87ca77333ef59171749544e8dbdba9009f0dc7.  We still don't have a user
yet.
This commit is contained in:
Kazu Hirata 2020-12-23 21:57:25 -08:00
parent eea8d75638
commit 3c1957b4e9
2 changed files with 0 additions and 21 deletions

View File

@ -87,13 +87,6 @@ class CallGraph {
/// or calling an external function.
std::unique_ptr<CallGraphNode> CallsExternalNode;
/// Replace the function represented by this node by another.
///
/// This does not rescan the body of the function, so it is suitable when
/// splicing the body of one function to another while also updating all
/// callers from the old function to the new.
void spliceFunction(const Function *From, const Function *To);
public:
explicit CallGraph(Module &M);
CallGraph(CallGraph &&Arg);

View File

@ -167,20 +167,6 @@ Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
return F;
}
/// spliceFunction - Replace the function represented by this node by another.
/// This does not rescan the body of the function, so it is suitable when
/// splicing the body of the old function to the new while also updating all
/// callers from old to new.
void CallGraph::spliceFunction(const Function *From, const Function *To) {
assert(FunctionMap.count(From) && "No CallGraphNode for function!");
assert(!FunctionMap.count(To) &&
"Pointing CallGraphNode at a function that already exists");
FunctionMapTy::iterator I = FunctionMap.find(From);
I->second->F = const_cast<Function*>(To);
FunctionMap[To] = std::move(I->second);
FunctionMap.erase(I);
}
// getOrInsertFunction - This method is identical to calling operator[], but
// it will insert a new CallGraphNode for the specified function if one does
// not already exist.