diff options
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index d58f90df1e..8f9b43fa86 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -81,6 +81,18 @@ void Loop::print(std::ostream &OS, unsigned Depth) const { (*I)->print(OS, Depth+2); } +/// verifyLoop - Verify loop structure +void Loop::verifyLoop() const { +#ifndef NDEBUG + assert (getHeader() && "Loop header is missing"); + assert (getLoopPreheader() && "Loop preheader is missing"); + assert (getLoopLatch() && "Loop latch is missing"); + for (std::vector<Loop*>::const_iterator I = SubLoops.begin(), E = SubLoops.end(); + I != E; ++I) + (*I)->verifyLoop(); +#endif +} + void Loop::dump() const { print(cerr); } @@ -104,7 +116,6 @@ void LoopInfo::releaseMemory() { TopLevelLoops.clear(); } - void LoopInfo::Calculate(DominatorTree &DT) { BasicBlock *RootNode = DT.getRootNode()->getBlock(); |