[llvm-commits] [llvm] r65593 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h
Dan Gohman
gohman at apple.com
Thu Feb 26 16:05:54 PST 2009
Author: djg
Date: Thu Feb 26 18:05:54 2009
New Revision: 65593
URL: http://llvm.org/viewvc/llvm-project?rev=65593&view=rev
Log:
Make LoopInfo::print() identify header, exit, and latch blocks,
and print the loop depth.
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=65593&r1=65592&r2=65593&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Thu Feb 26 18:05:54 2009
@@ -592,11 +592,16 @@
}
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";
More information about the llvm-commits
mailing list