Implement destructor for PostDominatorTree to eliminate a memory leak.
authorTorok Edwin <edwintorok@gmail.com>
Sat, 3 May 2008 20:25:26 +0000 (20:25 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Sat, 3 May 2008 20:25:26 +0000 (20:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50607 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/PostDominators.h
lib/Analysis/PostDominators.cpp

index 07910e9538c7cb6c013322bab035755916787d3b..27c2b26c8c2d34aeecdf23dbbc58f33427c4458c 100644 (file)
@@ -29,6 +29,8 @@ struct PostDominatorTree : public FunctionPass {
     DT = new DominatorTreeBase<BasicBlock>(true);
   }
 
+  ~PostDominatorTree();
+
   virtual bool runOnFunction(Function &F);
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
index 4330e9039d1a732daa3200534e38872d6a94cb79..c72b140a6224fec085d184253846e1dd8bd88d7f 100644 (file)
@@ -37,6 +37,11 @@ bool PostDominatorTree::runOnFunction(Function &F) {
   return false;
 }
 
+PostDominatorTree::~PostDominatorTree()
+{
+  delete DT;
+}
+
 //===----------------------------------------------------------------------===//
 //  PostDominanceFrontier Implementation
 //===----------------------------------------------------------------------===//