LLVM API Documentation

Classes | Public Member Functions | Static Public Member Functions
llvm::scc_iterator< GraphT, GT > Class Template Reference

Enumerate the SCCs of a directed graph in reverse topological order of the SCC DAG. More...

#include <SCCIterator.h>

Inheritance diagram for llvm::scc_iterator< GraphT, GT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::scc_iterator< GraphT, GT >:
Collaboration graph
[legend]

List of all members.

Classes

struct  StackElement

Public Member Functions

bool isAtEnd () const
 Direct loop termination test which is more efficient than comparison with end().
bool operator== (const scc_iterator &x) const
bool operator!= (const scc_iterator &x) const
scc_iteratoroperator++ ()
scc_iterator operator++ (int)
const SccTy & operator* () const
SccTy & operator* ()
bool hasLoop () const
 Test if the current SCC has a loop.
void ReplaceNode (NodeType *Old, NodeType *New)

Static Public Member Functions

static scc_iterator begin (const GraphT &G)
static scc_iterator end (const GraphT &)

Detailed Description

template<class GraphT, class GT = GraphTraits<GraphT>>
class llvm::scc_iterator< GraphT, GT >

Enumerate the SCCs of a directed graph in reverse topological order of the SCC DAG.

This is implemented using Tarjan's DFS algorithm using an internal stack to build up a vector of nodes in a particular SCC. Note that it is a forward iterator and thus you cannot backtrack or re-visit nodes.

Definition at line 39 of file SCCIterator.h.


Member Function Documentation

template<class GraphT, class GT = GraphTraits<GraphT>>
static scc_iterator llvm::scc_iterator< GraphT, GT >::begin ( const GraphT &  G) [inline, static]

Definition at line 163 of file SCCIterator.h.

Referenced by llvm::scc_begin().

template<class GraphT, class GT = GraphTraits<GraphT>>
static scc_iterator llvm::scc_iterator< GraphT, GT >::end ( const GraphT &  ) [inline, static]

Definition at line 166 of file SCCIterator.h.

Referenced by llvm::scc_end().

template<class GraphT, class GT = GraphTraits<GraphT>>
bool llvm::scc_iterator< GraphT, GT >::hasLoop ( ) const [inline]

Test if the current SCC has a loop.

If the SCC has more than one node, this is trivially true. If not, it may still contain a loop if the node has an edge back to itself.

Definition at line 203 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
bool llvm::scc_iterator< GraphT, GT >::isAtEnd ( ) const [inline]

Direct loop termination test which is more efficient than comparison with end().

Definition at line 170 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
bool llvm::scc_iterator< GraphT, GT >::operator!= ( const scc_iterator< GraphT, GT > &  x) const [inline]

Definition at line 178 of file SCCIterator.h.

References llvm::scc_iterator< GraphT, GT >::operator==().

template<class GraphT, class GT = GraphTraits<GraphT>>
const SccTy& llvm::scc_iterator< GraphT, GT >::operator* ( ) const [inline]

Definition at line 190 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
SccTy& llvm::scc_iterator< GraphT, GT >::operator* ( ) [inline]

Definition at line 194 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
scc_iterator& llvm::scc_iterator< GraphT, GT >::operator++ ( ) [inline]

Definition at line 180 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
scc_iterator llvm::scc_iterator< GraphT, GT >::operator++ ( int  ) [inline]

Definition at line 184 of file SCCIterator.h.

template<class GraphT, class GT = GraphTraits<GraphT>>
bool llvm::scc_iterator< GraphT, GT >::operator== ( const scc_iterator< GraphT, GT > &  x) const [inline]

Definition at line 175 of file SCCIterator.h.

Referenced by llvm::scc_iterator< GraphT, GT >::operator!=().

template<class GraphT, class GT = GraphTraits<GraphT>>
void llvm::scc_iterator< GraphT, GT >::ReplaceNode ( NodeType *  Old,
NodeType *  New 
) [inline]

This informs the scc_iterator that the specified Old node has been deleted, and New is to be used in its place.

Definition at line 217 of file SCCIterator.h.

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

Referenced by llvm::CallGraphSCC::ReplaceNode().


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