diff options
author | Chris Lattner <sabre@nondot.org> | 2006-12-05 19:46:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-12-05 19:46:12 +0000 |
commit | dd23d3dd0585cfac1e7ceaa9c86692a2fea4cf63 (patch) | |
tree | 3250668d0c78979dff1995e15c99dde9e0ac6694 /llvm/lib/Analysis/IPA/CallGraph.cpp | |
parent | e549bac57b55202d75366ccc3ca035b3f74ef89b (diff) | |
download | bcm5719-llvm-dd23d3dd0585cfac1e7ceaa9c86692a2fea4cf63.tar.gz bcm5719-llvm-dd23d3dd0585cfac1e7ceaa9c86692a2fea4cf63.zip |
straighten out various memory ownership issues in the callgraph stuff.
This fixes Regression/Other/2002-01-31-CallGraph.ll.
llvm-svn: 32237
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 61d00f02528..128e11ebd7f 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -51,11 +51,9 @@ class BasicCallGraph : public CallGraph, public ModulePass { public: BasicCallGraph() : Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} - ~BasicCallGraph() { destroy(); } // runOnModule - Compute the call graph for the specified module. virtual bool runOnModule(Module &M) { - destroy(); CallGraph::initialize(M); ExternalCallingNode = getOrInsertFunction(0); @@ -182,8 +180,10 @@ private: // // destroy - Release memory for the call graph virtual void destroy() { + /// CallsExternalNode is not in the function map, delete it explicitly. delete CallsExternalNode; CallsExternalNode = 0; + CallGraph::destroy(); } }; @@ -194,7 +194,6 @@ RegisterAnalysisGroup<CallGraph, true> Z(Y); } //End anonymous namespace void CallGraph::initialize(Module &M) { - destroy(); Mod = &M; } |