aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-07-28 20:28:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-07-28 20:28:50 +0000
commitee4b32d4d0ae14913fc511be0579e979d8ead6e8 (patch)
tree734153c5279d45fc261855524c9d4fb7089047a0 /lib/Analysis
parent145a11a0224f7c82bc68c113b5e84aaeee83ba8e (diff)
downloadexternal_llvm-ee4b32d4d0ae14913fc511be0579e979d8ead6e8.zip
external_llvm-ee4b32d4d0ae14913fc511be0579e979d8ead6e8.tar.gz
external_llvm-ee4b32d4d0ae14913fc511be0579e979d8ead6e8.tar.bz2
RegionInfo: Make sure to free cached nodes; Tobias, please check!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/RegionInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp
index ac660e7..6f38dcc 100644
--- a/lib/Analysis/RegionInfo.cpp
+++ b/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();