From 927793b6a165148af6d079ac03f97d13d296ff0d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 27 Feb 2009 00:05:54 +0000 Subject: [PATCH] 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 --- include/llvm/Analysis/LoopInfo.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 93bfcad1bc7..01e5fa96fcc 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 << "
"; + if (BB == getLoopLatch()) OS << ""; + if (isLoopExit(BB)) OS << ""; } OS << "\n";