summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-25 15:01:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-25 15:01:34 +0000
commit64cc1b0043a499b15e6d6d6ca99ecbf698ea86b1 (patch)
treef81146d49b0c23c19a974b2d00b75c361fdfc943 /llvm/lib
parenta59daaef3e8c9d8adc2e0ffed220dc8695896569 (diff)
downloadbcm5719-llvm-64cc1b0043a499b15e6d6d6ca99ecbf698ea86b1.tar.gz
bcm5719-llvm-64cc1b0043a499b15e6d6d6ca99ecbf698ea86b1.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 7620fd9842c..6c18d0d1a64 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -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;
OpenPOWER on IntegriCloud