[llvm] df3b56c - [Attributor][Fix] Avoid leaking memory after D68765

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 31 08:56:45 PST 2019


Author: Johannes Doerfert
Date: 2019-12-31T10:55:07-06:00
New Revision: df3b56c90544b17e645bcb1799ce60e3ae1d5c6d

URL: https://github.com/llvm/llvm-project/commit/df3b56c90544b17e645bcb1799ce60e3ae1d5c6d
DIFF: https://github.com/llvm/llvm-project/commit/df3b56c90544b17e645bcb1799ce60e3ae1d5c6d.diff

LOG: [Attributor][Fix] Avoid leaking memory after D68765

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 3f4087b9c953..1aafab028bae 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -694,7 +694,11 @@ struct Attributor {
       : InfoCache(InfoCache), DepRecomputeInterval(DepRecomputeInterval),
         Whitelist(Whitelist) {}
 
-  ~Attributor() { DeleteContainerPointers(AllAbstractAttributes); }
+  ~Attributor() {
+    DeleteContainerPointers(AllAbstractAttributes);
+    for (auto &It : ArgumentReplacementMap)
+      DeleteContainerPointers(It.second);
+  }
 
   /// Run the analyses until a fixpoint is reached or enforced (timeout).
   ///


        


More information about the llvm-commits mailing list