summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-27 00:05:54 +0000
committerDan Gohman <gohman@apple.com>2009-02-27 00:05:54 +0000
commit927793b6a165148af6d079ac03f97d13d296ff0d (patch)
tree8f6582bd5fcb8e58fecd650b4f8491b05c018310 /include
parentefc783951c0ab801601aeaeae07ef2a7305d37b0 (diff)
downloadllvm-927793b6a165148af6d079ac03f97d13d296ff0d.tar.gz
llvm-927793b6a165148af6d079ac03f97d13d296ff0d.tar.bz2
llvm-927793b6a165148af6d079ac03f97d13d296ff0d.tar.xz
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/LoopInfo.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 93bfcad1bc..01e5fa96fc 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -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";