diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-07-28 20:28:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-28 20:28:50 +0000 |
commit | 18e39cec7a26d0673c5f362110e0fe7cdfed77f1 (patch) | |
tree | cfb0093bce6dac44b67fda56345fad3975b90059 /llvm/lib/Analysis/RegionInfo.cpp | |
parent | e397dded7bf07c1e6b3a39fd39afef539933f53a (diff) | |
download | bcm5719-llvm-18e39cec7a26d0673c5f362110e0fe7cdfed77f1.tar.gz bcm5719-llvm-18e39cec7a26d0673c5f362110e0fe7cdfed77f1.zip |
RegionInfo: Make sure to free cached nodes; Tobias, please check!
llvm-svn: 109650
Diffstat (limited to 'llvm/lib/Analysis/RegionInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/RegionInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp index ac660e72f07..6f38dcc9681 100644 --- a/llvm/lib/Analysis/RegionInfo.cpp +++ b/llvm/lib/Analysis/RegionInfo.cpp @@ -59,6 +59,11 @@ Region::Region(BasicBlock *Entry, BasicBlock *Exit, RegionInfo* RInfo, : RegionNode(Parent, Entry, 1), RI(RInfo), DT(dt), exit(Exit) {} Region::~Region() { + // Free the cached nodes. + for (BBNodeMapT::iterator it = BBNodeMap.begin(), + ie = BBNodeMap.end(); it != ie; ++it) + delete it->second; + // Only clean the cache for this Region. Caches of child Regions will be // cleaned when the child Regions are deleted. BBNodeMap.clear(); |