LLVM 20.0.0git
|
Traverse the blocks in a loop using a depth-first search. More...
#include "llvm/Analysis/LoopIterator.h"
Public Types | |
typedef po_iterator< BasicBlock *, LoopBlocksTraversal, true > | POTIterator |
Graph traversal iterator. | |
Public Member Functions | |
LoopBlocksTraversal (LoopBlocksDFS &Storage, const LoopInfo *LInfo) | |
POTIterator | begin () |
Postorder traversal over the graph. | |
POTIterator | end () |
bool | visitPreorder (BasicBlock *BB) |
Called by po_iterator upon reaching a block via a CFG edge. | |
void | finishPostorder (BasicBlock *BB) |
Called by po_iterator each time it advances, indicating a block's postorder. | |
Traverse the blocks in a loop using a depth-first search.
Definition at line 200 of file LoopIterator.h.
Graph traversal iterator.
Definition at line 203 of file LoopIterator.h.
|
inline |
Definition at line 210 of file LoopIterator.h.
|
inline |
Postorder traversal over the graph.
This only needs to be done once. po_iterator "automatically" calls back to visitPreorder and finishPostorder to record the DFS result.
Definition at line 216 of file LoopIterator.h.
References assert(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getNumBlocks(), and llvm::po_ext_begin().
Referenced by llvm::LoopBlocksDFS::perform().
|
inline |
Definition at line 221 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getHeader(), and llvm::po_ext_end().
Referenced by llvm::LoopBlocksDFS::perform().
|
inline |
Called by po_iterator each time it advances, indicating a block's postorder.
Definition at line 240 of file LoopIterator.h.
References assert().
|
inline |
Called by po_iterator upon reaching a block via a CFG edge.
If this block is contained in the loop and has not been visited, then mark it preorder visited and return true.
TODO: If anyone is interested, we could record preorder numbers here.
Definition at line 231 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::contains(), and llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor().