aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-18 00:22:13 +0000
committerChris Lattner <sabre@nondot.org>2004-09-18 00:22:13 +0000
commit6f7e5ebb42706511a310febc926305844bd74cb7 (patch)
tree3ab806288e03144c813f4146a3d03d22d0af7b71 /lib/Analysis/IPA/CallGraph.cpp
parent794cbc22b748ea43d69fb774c3afb1dc3543791f (diff)
Implement new changeFunction method, nuke a never implemented one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 75e068ba54..8b46e59274 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -163,14 +163,6 @@ void CallGraph::dump() const {
// Implementations of public modification methods
//
-// Functions to keep a call graph up to date with a function that has been
-// modified
-//
-void CallGraph::addFunctionToModule(Function *F) {
- assert(0 && "not implemented");
- abort();
-}
-
// 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
@@ -188,6 +180,20 @@ Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
return F;
}
+// changeFunction - This method changes the function associated with this
+// CallGraphNode, for use by transformations that need to change the prototype
+// of a Function (thus they must create a new Function and move the old code
+// over).
+void CallGraph::changeFunction(Function *OldF, Function *NewF) {
+ iterator I = FunctionMap.find(OldF);
+ CallGraphNode *&New = FunctionMap[NewF];
+ assert(I != FunctionMap.end() && I->second && !New &&
+ "OldF didn't exist in CG or NewF already does!");
+ New = I->second;
+ FunctionMap.erase(I);
+}
+
+
void CallGraph::stub() {}
void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {