From ec649acb82e58d7dcb1644fa5df41caae4fb90ac Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 15 Apr 2014 18:32:43 +0000 Subject: Use unique_ptr to manage ownership of child Regions within llvm::Region llvm-svn: 206310 --- llvm/lib/Analysis/RegionPass.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Analysis/RegionPass.cpp') diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp index b29070a4fbf..1798c36fc13 100644 --- a/llvm/lib/Analysis/RegionPass.cpp +++ b/llvm/lib/Analysis/RegionPass.cpp @@ -36,10 +36,10 @@ RGPassManager::RGPassManager() } // Recurse through all subregions and all regions into RQ. -static void addRegionIntoQueue(Region *R, std::deque &RQ) { - RQ.push_back(R); - for (Region::iterator I = R->begin(), E = R->end(); I != E; ++I) - addRegionIntoQueue(*I, RQ); +static void addRegionIntoQueue(Region &R, std::deque &RQ) { + RQ.push_back(&R); + for (const auto &E : R) + addRegionIntoQueue(*E, RQ); } /// Pass Manager itself does not invalidate any analysis info. @@ -57,7 +57,7 @@ bool RGPassManager::runOnFunction(Function &F) { // Collect inherited analysis from Module level pass manager. populateInheritedAnalysis(TPM->activeStack); - addRegionIntoQueue(RI->getTopLevelRegion(), RQ); + addRegionIntoQueue(*RI->getTopLevelRegion(), RQ); if (RQ.empty()) // No regions, skip calling finalizers return false; -- cgit v1.2.3