diff options
-rw-r--r-- | llvm/include/llvm/Analysis/AliasSetTracker.h | 1 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h index 3aafb80af80..a020ec3f1a7 100644 --- a/llvm/include/llvm/Analysis/AliasSetTracker.h +++ b/llvm/include/llvm/Analysis/AliasSetTracker.h @@ -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 diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 08c0a888515..c86b4639489 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -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; } |