mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
straighten out various memory ownership issues in the callgraph stuff.
This fixes Regression/Other/2002-01-31-CallGraph.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32237 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8257bee70b
commit
f2d9ceb5b9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user