CRTP base for a single post‐order graph walk.

Synopsis

Declared in <llvm/ADT/PostOrderIterator.h>

template<
    typename DerivedT,
    typename GraphTraits>
class PostOrderTraversalBase;

Description

Subclasses provide visited storage via insertEdge(). Call init() with the start node before iterating. finishPostorder() observes each node just before the iterator advances; insertEdge() can skip unwanted nodes by returning false.

Types

Name

Description

iterator

Input iterator yielding nodes in post‐order during a single traversal.

Member Functions

Name

Description

begin

Iterator to the current post‐order node, or end if none remain.

end

Past‐the‐end iterator for this traversal.

finishPostorder

Callback just before the iterator moves to the next block.

insertEdge

Add edge and return whether To should be visited. From is nullopt for the root node.

Protected Member Functions

Name

Description

PostOrderTraversalBase [constructor]

Construct an uninitialized traversal base.

derived

Return this object cast to the CRTP derived type.

init

Initialize post‐order traversal at given start node.

Derived Classes

Name

Description

LoopBlocksTraversal

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

PostOrderExtTraversal

Post‐order traversal using an external visited set.

PostOrderTraversal

Post‐order traversal of a graph.

Created with MrDocs