class LoopBlocksTraversal

Declaration

class LoopBlocksTraversal { /* full declaration omitted */ };

Description

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

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:200

Member Variables

private llvm::LoopBlocksDFS& DFS
private llvm::LoopInfo* LI

Method Overview

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

Methods

LoopBlocksTraversal(llvm::LoopBlocksDFS& Storage,
                    llvm::LoopInfo* LInfo)

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:210

Parameters

llvm::LoopBlocksDFS& Storage
llvm::LoopInfo* LInfo

llvm::LoopBlocksTraversal::POTIterator begin()

Description

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.

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:216

llvm::LoopBlocksTraversal::POTIterator end()

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:221

void finishPostorder(llvm::BasicBlock* BB)

Description

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

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:240

Parameters

llvm::BasicBlock* BB

bool visitPreorder(llvm::BasicBlock* BB)

Description

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.

Declared at: llvm/include/llvm/Analysis/LoopIterator.h:231

Parameters

llvm::BasicBlock* BB