mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-22 13:32:09 +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? llvm-svn: 193412
This commit is contained in:
parent
0617dece78
commit
cd9791ce72
@ -152,7 +152,7 @@ protected:
|
||||
CallGraph() {}
|
||||
|
||||
public:
|
||||
virtual ~CallGraph() { destroy(); }
|
||||
virtual ~CallGraph() { }
|
||||
|
||||
/// initialize - Call this method before calling other methods,
|
||||
/// re/initializes the state of the CallGraph.
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user