From aa0e52328747d982d6c6e501a205832ad724ff62 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 5 Feb 2010 19:24:11 +0000 Subject: [PATCH] Implement releaseMemory in CodeGenPrepare and free the BackEdges container data. This prevents it from holding onto dangling pointers and potentially behaving unpredictably. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95409 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index c3139a511bb..fa60d3f2906 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -63,6 +63,10 @@ namespace { AU.addPreserved(); } + virtual void releaseMemory() { + BackEdges.clear(); + } + private: bool EliminateMostlyEmptyBlocks(Function &F); bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;