[Modules] Move ValueHandle into the IR library where Value itself lives.
[oota-llvm.git] / lib / Analysis / RegionPass.cpp
index 80eda79d8a425e10abec1ca84f0fbdba8a6af969..ac4e1149f086c51eb1a55bfa5dfa1d8c44a36821 100644 (file)
@@ -27,8 +27,8 @@ using namespace llvm;
 
 char RGPassManager::ID = 0;
 
-RGPassManager::RGPassManager(int Depth)
-  : FunctionPass(ID), PMDataManager(Depth) {
+RGPassManager::RGPassManager()
+  : FunctionPass(ID), PMDataManager() {
   skipThisRegion = false;
   redoThisRegion = false;
   RI = NULL;
@@ -195,9 +195,8 @@ public:
 
   virtual bool runOnRegion(Region *R, RGPassManager &RGM) {
     Out << Banner;
-    for (Region::block_iterator I = R->block_begin(), E = R->block_end();
-         I != E; ++I)
-      (*I)->getEntry()->print(Out);
+    for (const auto &BB : R->blocks())
+      BB->print(Out);
 
     return false;
   }
@@ -250,7 +249,7 @@ void RegionPass::assignPassManager(PMStack &PMS,
     PMDataManager *PMD = PMS.top();
 
     // [1] Create new Region Pass Manager
-    RGPM = new RGPassManager(PMD->getDepth() + 1);
+    RGPM = new RGPassManager();
     RGPM->populateInheritedAnalysis(PMS);
 
     // [2] Set up new manager's top level manager