mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Call destroy from ~BasicCallGraph.
This fix a memory leak found by valgrind. Calling it from the base class destructor would not destroy the BasicCallGraph bits. FIXME: BasicCallGraph is the only thing that inherits from CallGraph. Can we merge the two? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193412 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,12 +46,16 @@ public:
|
||||
ExternalCallingNode(0), CallsExternalNode(0) {
|
||||
initializeBasicCallGraphPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
~BasicCallGraph() {
|
||||
destroy();
|
||||
}
|
||||
|
||||
// runOnModule - Compute the call graph for the specified module.
|
||||
virtual bool runOnModule(Module &M) {
|
||||
CallGraph::initialize(M);
|
||||
|
||||
ExternalCallingNode = getOrInsertFunction(0);
|
||||
assert(!CallsExternalNode);
|
||||
CallsExternalNode = new CallGraphNode(0);
|
||||
Root = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user