diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-05 19:24:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-05 19:24:11 +0000 |
commit | aa0e52328747d982d6c6e501a205832ad724ff62 (patch) | |
tree | 14476d49fc5eeb0e0cae1b16f86566eb1927852d /lib/Transforms | |
parent | a62fe66f9916079f97d317f7152f1ac428b4f65a (diff) | |
download | external_llvm-aa0e52328747d982d6c6e501a205832ad724ff62.zip external_llvm-aa0e52328747d982d6c6e501a205832ad724ff62.tar.gz external_llvm-aa0e52328747d982d6c6e501a205832ad724ff62.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index c3139a5..fa60d3f 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -63,6 +63,10 @@ namespace { AU.addPreserved<ProfileInfo>(); } + virtual void releaseMemory() { + BackEdges.clear(); + } + private: bool EliminateMostlyEmptyBlocks(Function &F); bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const; |