From: Tobias Grosser Date: Wed, 13 Oct 2010 00:07:59 +0000 (+0000) Subject: RegionInfo: Free the RegionNodes in cache. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=67be08a2f186d8262781f0d1ef67cab3cd2a0d2b;p=oota-llvm.git RegionInfo: Free the RegionNodes in cache. Contributed by: ether git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116380 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp index 95b78cd443d..6593f07ff3c 100644 --- a/lib/Analysis/RegionInfo.cpp +++ b/lib/Analysis/RegionInfo.cpp @@ -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();