[llvm-commits] [llvm] r109650 - /llvm/trunk/lib/Analysis/RegionInfo.cpp

Daniel Dunbar daniel at zuster.org
Wed Jul 28 13:28:50 PDT 2010


Author: ddunbar
Date: Wed Jul 28 15:28:50 2010
New Revision: 109650

URL: http://llvm.org/viewvc/llvm-project?rev=109650&view=rev
Log:
RegionInfo: Make sure to free cached nodes; Tobias, please check!

Modified:
    llvm/trunk/lib/Analysis/RegionInfo.cpp

Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=109650&r1=109649&r2=109650&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/RegionInfo.cpp Wed Jul 28 15:28:50 2010
@@ -59,6 +59,11 @@
                : 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();





More information about the llvm-commits mailing list