/// Verify loop structure of this loop and all nested loops.
void verifyLoopNest(DenseSet<const LoopT*> *Loops) const;
- void print(raw_ostream &OS, unsigned Depth = 0) const;
+ void print(raw_ostream &OS, unsigned Depth = 0, bool Verbose = false) const;
+
+ /// Print loop with all the BBs inside it.
+ void printVerbose(raw_ostream &OS, unsigned Depth = 0) const;
protected:
friend class LoopInfoBase<BlockT, LoopT>;
BasicBlock *getUniqueExitBlock() const;
void dump() const;
+ void dumpVerbose() const;
/// Return the debug location of the start of this loop.
/// This looks for a BB terminating instruction with a known debug
}
template<class BlockT, class LoopT>
-void LoopBase<BlockT, LoopT>::print(raw_ostream &OS, unsigned Depth) const {
+void LoopBase<BlockT, LoopT>::print(raw_ostream &OS, unsigned Depth,
+ bool Verbose) const {
OS.indent(Depth*2) << "Loop at depth " << getLoopDepth()
<< " containing: ";
+ BlockT *H = getHeader();
for (unsigned i = 0; i < getBlocks().size(); ++i) {
- if (i) OS << ",";
BlockT *BB = getBlocks()[i];
- BB->printAsOperand(OS, false);
- if (BB == getHeader()) OS << "<header>";
- if (BB == getLoopLatch()) OS << "<latch>";
- if (isLoopExiting(BB)) OS << "<exiting>";
+ if (!Verbose) {
+ if (i) OS << ",";
+ BB->printAsOperand(OS, false);
+ } else OS << "\n";
+
+ if (BB == H) OS << "<header>";
+ if (isLoopLatch(BB)) OS << "<latch>";
+ if (isLoopExiting(BB)) OS << "<exiting>";
+ if (Verbose)
+ BB->print(OS);
}
OS << "\n";
LLVM_DUMP_METHOD void Loop::dump() const {
print(dbgs());
}
+
+LLVM_DUMP_METHOD void Loop::dumpVerbose() const {
+ print(dbgs(), /*Depth=*/ 0, /*Verbose=*/ true);
+}
#endif
//===----------------------------------------------------------------------===//