Author: Kazu Hirata Date: 2020-12-23T21:57:25-08:00 New Revision: 200b15af45a6de494ecd0b76c1b1eb661edbdb60
URL: https://github.com/llvm/llvm-project/commit/200b15af45a6de494ecd0b76c1b1eb661edbdb60 DIFF: https://github.com/llvm/llvm-project/commit/200b15af45a6de494ecd0b76c1b1eb661edbdb60.diff LOG: [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. Added: Modified: llvm/include/llvm/Analysis/CallGraph.h llvm/lib/Analysis/CallGraph.cpp Removed: ################################################################################ diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h index 98f9b0683fd4..4da448c9900b 100644 --- a/llvm/include/llvm/Analysis/CallGraph.h +++ b/llvm/include/llvm/Analysis/CallGraph.h @@ -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); diff --git a/llvm/lib/Analysis/CallGraph.cpp b/llvm/lib/Analysis/CallGraph.cpp index 19c128b6633c..9b212e564a46 100644 --- a/llvm/lib/Analysis/CallGraph.cpp +++ b/llvm/lib/Analysis/CallGraph.cpp @@ -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. _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits