llvm::df_iterator

Generic depth-first search iterator over a graph.

Synopsis

Declared in <llvm/ADT/DepthFirstIterator.h>

template<
    class GraphT,
    class SetType = df_iterator_default_set<GraphTraits<GraphT>::NodeRef>,
    bool ExtStorage = false,
    class GT = GraphTraits<GraphT>>
class df_iterator
    : public df_iterator_storage<SetType, ExtStorage>

Description

Visits each reachable node once, descending into children before siblings. When ExtStorage is true, the visited set is provided externally.

Base Classes

NameDescription
df_iterator_storage<SetType, ExtStorage>Storage for the visited-node set used by depth-first iterators.

Type Aliases

NameDescription
difference_type Distance between two depth-first iterators.
iterator_category Iterator category: input when using external storage, otherwise forward.
pointer Pointer to a node reference.
reference Const reference to the current node.
value_type Node reference type yielded by this iterator.

Member Functions

NameDescription
getPath Return the n'th node in the path from the entry node to the current node.
getPathLength Return the length of the path from the entry node to the current node, counting both nodes.
nodeVisited Return true if this iterator has already visited Node.
operator* Return a reference to the current node.
operator++ Increment operators
operator-> Return the current node so methods can be called through the iterator.
skipChildren Skips all children of the current node and traverses to next node
operator== Return true if both iterators have the same visit-stack state.
operator!= Return true if the iterators differ in visit-stack state.

Static Member Functions

NameDescription
begin begin overloads
end end overloads

Data Members

NameDescription
Visited Set of nodes already visited during depth-first traversal.

Non-Member Functions

NameDescription
depth_firstReturn a range that visits G in depth-first order.
df_beginReturn a depth-first iterator at the entry of G.
df_endReturn a past-the-end depth-first iterator for G.

Derived Classes

NameDescription
block_iterator_wrapper Depth-first flat iterator over BasicBlocks contained in a Region.
df_ext_iterator Depth-first iterator that stores its visited set externally.
idf_iterator Depth-first iterator over the inverse of graph T.