X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FRegionPass.cpp;h=de34b727a5a0dbd1ec1880eaa5a88490d3d78b2e;hb=1cb132f921c55f9584d06787b849ef0f255403b2;hp=1798c36fc1312168cce7521bc4a8ff49776cb64f;hpb=2bbc5a7e2cf6292ca246915510b22263e5f6901a;p=oota-llvm.git diff --git a/lib/Analysis/RegionPass.cpp b/lib/Analysis/RegionPass.cpp index 1798c36fc13..de34b727a5a 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 // @@ -44,14 +45,14 @@ static void addRegionIntoQueue(Region &R, std::deque &RQ) { /// Pass Manager itself does not invalidate any analysis info. void RGPassManager::getAnalysisUsage(AnalysisUsage &Info) const { - Info.addRequired(); + Info.addRequired(); 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(); + RI = &getAnalysis().getRegionInfo(); bool Changed = false; // Collect inherited analysis from Module level pass manager. @@ -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) {} @@ -195,8 +195,12 @@ public: bool runOnRegion(Region *R, RGPassManager &RGM) override { Out << Banner; - for (const auto &BB : R->blocks()) - BB->print(Out); + for (const auto &BB : R->blocks()) { + if (BB) + BB->print(Out); + else + Out << "Printing Block"; + } return false; }