Make LoopInfo::print() identify header, exit, and latch blocks,

and print the loop depth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-02-27 00:05:54 +00:00
parent efc783951c
commit 927793b6a1

View File

@ -592,11 +592,16 @@ public:
}
void print(std::ostream &OS, unsigned Depth = 0) const {
OS << std::string(Depth*2, ' ') << "Loop Containing: ";
OS << std::string(Depth*2, ' ') << "Loop at depth " << getLoopDepth()
<< " containing: ";
for (unsigned i = 0; i < getBlocks().size(); ++i) {
if (i) OS << ",";
WriteAsOperand(OS, getBlocks()[i], false);
BlockT *BB = getBlocks()[i];
WriteAsOperand(OS, BB, false);
if (BB == getHeader()) OS << "<header>";
if (BB == getLoopLatch()) OS << "<latch>";
if (isLoopExit(BB)) OS << "<exit>";
}
OS << "\n";