aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/CallGraph.h
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-03 03:19:35 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-03 03:19:35 +0000
commit9ad1cb59deda265441c1614fee5ec7f7dea7625d (patch)
tree23a60b8dc6e5b1485fda1961812388425c21d0ee /include/llvm/Analysis/CallGraph.h
parent8e7f0d70c7dd3864126c746378a7b928d57f971f (diff)
Add spliceFunction to the CallGraph interface. This allows users to efficiently
update a callGraph when performing the common operation of splicing the body to a new function and updating all callers (such as via RAUW). No users yet, though this is intended for DeadArgumentElimination as part of PR8887. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/CallGraph.h')
-rw-r--r--include/llvm/Analysis/CallGraph.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index 9dfe89416a..089f322e4a 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -138,6 +138,13 @@ public:
/// not already exist.
CallGraphNode *getOrInsertFunction(const Function *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 one function to another while also updating all
+ /// callers from the old function to the new.
+ ///
+ void spliceFunction(const Function *From, const Function *To);
+
//===---------------------------------------------------------------------
// Pass infrastructure interface glue code.
//
@@ -163,8 +170,10 @@ protected:
// CallGraphNode class definition.
//
class CallGraphNode {
- AssertingVH<Function> F;
+ friend class CallGraph;
+ AssertingVH<Function> F;
+
// CallRecord - This is a pair of the calling instruction (a call or invoke)
// and the callgraph node being called.
public: