aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/RegionPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/RegionPass.cpp')
-rw-r--r--lib/Analysis/RegionPass.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Analysis/RegionPass.cpp b/lib/Analysis/RegionPass.cpp
index 12d7ca3..3c7798f 100644
--- a/lib/Analysis/RegionPass.cpp
+++ b/lib/Analysis/RegionPass.cpp
@@ -17,10 +17,11 @@
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Support/Timer.h"
-#define DEBUG_TYPE "regionpassmgr"
#include "llvm/Support/Debug.h"
using namespace llvm;
+#define DEBUG_TYPE "regionpassmgr"
+
//===----------------------------------------------------------------------===//
// RGPassManager
//
@@ -31,15 +32,15 @@ RGPassManager::RGPassManager()
: FunctionPass(ID), PMDataManager() {
skipThisRegion = false;
redoThisRegion = false;
- RI = NULL;
- CurrentRegion = NULL;
+ RI = nullptr;
+ CurrentRegion = nullptr;
}
// Recurse through all subregions and all regions into RQ.
-static void addRegionIntoQueue(Region *R, std::deque<Region *> &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<Region *> &RQ) {
+ RQ.push_back(&R);
+ for (const auto &E : R)
+ addRegionIntoQueue(*E, RQ);
}
/// Pass Manager itself does not invalidate any analysis info.
@@ -57,7 +58,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;
@@ -185,7 +186,6 @@ private:
public:
static char ID;
- PrintRegionPass() : RegionPass(ID), Out(dbgs()) {}
PrintRegionPass(const std::string &B, raw_ostream &o)
: RegionPass(ID), Banner(B), Out(o) {}