Clean up the formatting and trailing whitespace of a routine before
[oota-llvm.git] / lib / Analysis / RegionPass.cpp
index d11b3323cac6aae95866aab2b8f60d9dee74ba72..de34b727a5a0dbd1ec1880eaa5a88490d3d78b2e 100644 (file)
@@ -45,14 +45,14 @@ static void addRegionIntoQueue(Region &R, std::deque<Region *> &RQ) {
 
 /// Pass Manager itself does not invalidate any analysis info.
 void RGPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
-  Info.addRequired<RegionInfo>();
+  Info.addRequired<RegionInfoPass>();
   Info.setPreservesAll();
 }
 
 /// run - Execute all of the passes scheduled for execution.  Keep track of
 /// whether any of the passes modifies the function, and if so, return true.
 bool RGPassManager::runOnFunction(Function &F) {
-  RI = &getAnalysis<RegionInfo>();
+  RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
   bool Changed = false;
 
   // Collect inherited analysis from Module level pass manager.
@@ -196,8 +196,10 @@ public:
   bool runOnRegion(Region *R, RGPassManager &RGM) override {
     Out << Banner;
     for (const auto &BB : R->blocks()) {
-      assert(BB != nullptr && "Expecting non-null Block");
-      BB->print(Out);
+      if (BB)
+        BB->print(Out);
+      else
+        Out << "Printing <null> Block";
     }
 
     return false;