summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-05 19:24:11 +0000
committerDan Gohman <gohman@apple.com>2010-02-05 19:24:11 +0000
commit4739e41ce91ccff84e94c6689b37030267edaaf5 (patch)
tree54e628d8188e8c4e7abca3abbcc197e466edaa28
parent342762fdbac9407625836b6753290001aaf3afbd (diff)
downloadbcm5719-llvm-4739e41ce91ccff84e94c6689b37030267edaaf5.tar.gz
bcm5719-llvm-4739e41ce91ccff84e94c6689b37030267edaaf5.zip
Implement releaseMemory in CodeGenPrepare and free the BackEdges
container data. This prevents it from holding onto dangling pointers and potentially behaving unpredictably. llvm-svn: 95409
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index c3139a511bb..fa60d3f2906 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud