LLVM API Documentation

Public Types | Public Member Functions
llvm::LoopBlocksTraversal Class Reference

Traverse the blocks in a loop using a depth-first search. More...

#include <LoopIterator.h>

List of all members.

Public Types

typedef po_iterator
< BasicBlock
*, LoopBlocksTraversal, true
POTIterator
 Graph traversal iterator.

Public Member Functions

 LoopBlocksTraversal (LoopBlocksDFS &Storage, LoopInfo *LInfo)
POTIterator begin ()
POTIterator end ()
bool visitPreorder (BasicBlock *BB)
void finishPostorder (BasicBlock *BB)

Detailed Description

Traverse the blocks in a loop using a depth-first search.

Definition at line 122 of file LoopIterator.h.


Member Typedef Documentation

Graph traversal iterator.

Definition at line 125 of file LoopIterator.h.


Constructor & Destructor Documentation

Definition at line 132 of file LoopIterator.h.


Member Function Documentation

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 138 of file LoopIterator.h.

References llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getNumBlocks(), and llvm::po_ext_begin().

Referenced by llvm::LoopBlocksDFS::perform().

Called by po_iterator each time it advances, indicating a block's postorder.

Definition at line 162 of file LoopIterator.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count().

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 153 of file LoopIterator.h.

References llvm::LoopBase< BlockT, LoopT >::contains(), llvm::LoopInfo::getLoopFor(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert().


The documentation for this class was generated from the following file: