Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 25 Nov 2007 23:52:02 +0000 (23:52 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 25 Nov 2007 23:52:02 +0000 (23:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44320 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasSetTracker.h
lib/Transforms/Scalar/LICM.cpp

index 3aafb80af801ec4ded288b2c6d270e1ba1109bcb..a020ec3f1a7fb582b93ef48d8587b07795db0882 100644 (file)
@@ -263,6 +263,7 @@ public:
   /// the specified alias analysis object to disambiguate load and store
   /// addresses.
   explicit AliasSetTracker(AliasAnalysis &aa) : AA(aa) {}
+  ~AliasSetTracker() { clear(); }
 
   /// add methods - These methods are used to add different types of
   /// instructions to the alias sets.  Adding a new instruction can result in
index 08c0a88851520bf0e9b6f8cb846cafb88f8cac46..c86b463948905b2f19571eafc54809e8c7940b1b 100644 (file)
@@ -84,6 +84,11 @@ namespace {
     }
 
     bool doFinalization() {
+      // Free the values stored in the map
+      for (std::map<Loop *, AliasSetTracker *>::iterator
+             I = LoopToAliasMap.begin(), E = LoopToAliasMap.end(); I != E; ++I)
+        delete I->second;
+
       LoopToAliasMap.clear();
       return false;
     }