RegionInfo: Free the RegionNodes in cache.
authorTobias Grosser <grosser@fim.uni-passau.de>
Wed, 13 Oct 2010 00:07:59 +0000 (00:07 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Wed, 13 Oct 2010 00:07:59 +0000 (00:07 +0000)
Contributed by: ether

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116380 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionInfo.cpp

index 95b78cd443d4b4bae2aa8f115776e08b17ef294a..6593f07ff3c4593ed396dc899232f20a215d42c0 100644 (file)
@@ -376,6 +376,11 @@ void Region::dump() const {
 }
 
 void Region::clearNodeCache() {
+  // Free the cached nodes.
+  for (BBNodeMapT::iterator I = BBNodeMap.begin(),
+       IE = BBNodeMap.end(); I != IE; ++IE)
+    delete I->second;
+
   BBNodeMap.clear();
   for (Region::iterator RI = begin(), RE = end(); RI != RE; ++RI)
     (*RI)->clearNodeCache();