LLVM  10.0.0svn
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::DGNode< NodeType, EdgeType > Class Template Reference

Represent a node in the directed graph. More...

#include "llvm/ADT/DirectedGraph.h"

Inheritance diagram for llvm::DGNode< NodeType, EdgeType >:
Inheritance graph
[legend]
Collaboration diagram for llvm::DGNode< NodeType, EdgeType >:
Collaboration graph
[legend]

Public Types

using EdgeListTy = SetVector< EdgeType * >
 
using iterator = typename EdgeListTy::iterator
 
using const_iterator = typename EdgeListTy::const_iterator
 

Public Member Functions

 DGNode (EdgeType &E)
 Create a node with a single outgoing edge E. More...
 
 DGNode ()=default
 
 DGNode (const DGNode< NodeType, EdgeType > &N)
 
 DGNode (DGNode< NodeType, EdgeType > &&N)
 
DGNode< NodeType, EdgeType > & operator= (const DGNode< NodeType, EdgeType > &N)
 
DGNode< NodeType, EdgeType > & operator= (const DGNode< NodeType, EdgeType > &&N)
 
bool operator== (const NodeType &N) const
 Static polymorphism: delegate implementation (via isEqualTo) to the derived class. More...
 
bool operator!= (const NodeType &N) const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const EdgeType & front () const
 
EdgeType & front ()
 
const EdgeType & back () const
 
EdgeType & back ()
 
bool findEdgesTo (const NodeType &N, SmallVectorImpl< EdgeType *> &EL) const
 Collect in EL, all the edges from this node to N. More...
 
bool addEdge (EdgeType &E)
 Add the given edge E to this node, if it doesn't exist already. More...
 
void removeEdge (EdgeType &E)
 Remove the given edge E from this node, if it exists. More...
 
bool hasEdgeTo (const NodeType &N) const
 Test whether there is an edge that goes from this node to N. More...
 
const EdgeListTygetEdges () const
 Retrieve the outgoing edges for the node. More...
 
EdgeListTygetEdges ()
 
void clear ()
 Clear the outgoing edges. More...
 

Protected Member Functions

bool isEqualTo (const NodeType &N) const
 
NodeType & getDerived ()
 
const NodeType & getDerived () const
 
const_iterator findEdgeTo (const NodeType &N) const
 Find an edge to N. More...
 

Protected Attributes

EdgeListTy Edges
 

Detailed Description

template<class NodeType, class EdgeType>
class llvm::DGNode< NodeType, EdgeType >

Represent a node in the directed graph.

The node has a (possibly empty) list of outgoing edges.

Definition at line 67 of file DirectedGraph.h.

Member Typedef Documentation

◆ const_iterator

template<class NodeType, class EdgeType>
using llvm::DGNode< NodeType, EdgeType >::const_iterator = typename EdgeListTy::const_iterator

Definition at line 71 of file DirectedGraph.h.

◆ EdgeListTy

template<class NodeType, class EdgeType>
using llvm::DGNode< NodeType, EdgeType >::EdgeListTy = SetVector<EdgeType *>

Definition at line 69 of file DirectedGraph.h.

◆ iterator

template<class NodeType, class EdgeType>
using llvm::DGNode< NodeType, EdgeType >::iterator = typename EdgeListTy::iterator

Definition at line 70 of file DirectedGraph.h.

Constructor & Destructor Documentation

◆ DGNode() [1/4]

template<class NodeType, class EdgeType>
llvm::DGNode< NodeType, EdgeType >::DGNode ( EdgeType &  E)
inlineexplicit

Create a node with a single outgoing edge E.

Definition at line 74 of file DirectedGraph.h.

◆ DGNode() [2/4]

template<class NodeType, class EdgeType>
llvm::DGNode< NodeType, EdgeType >::DGNode ( )
default

◆ DGNode() [3/4]

template<class NodeType, class EdgeType>
llvm::DGNode< NodeType, EdgeType >::DGNode ( const DGNode< NodeType, EdgeType > &  N)
inlineexplicit

Definition at line 77 of file DirectedGraph.h.

◆ DGNode() [4/4]

template<class NodeType, class EdgeType>
llvm::DGNode< NodeType, EdgeType >::DGNode ( DGNode< NodeType, EdgeType > &&  N)
inline

Definition at line 78 of file DirectedGraph.h.

Member Function Documentation

◆ addEdge()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::addEdge ( EdgeType &  E)
inline

Add the given edge E to this node, if it doesn't exist already.

Returns true if the edge is added and false otherwise.

Definition at line 117 of file DirectedGraph.h.

◆ back() [1/2]

template<class NodeType, class EdgeType>
const EdgeType& llvm::DGNode< NodeType, EdgeType >::back ( ) const
inline

Definition at line 100 of file DirectedGraph.h.

◆ back() [2/2]

template<class NodeType, class EdgeType>
EdgeType& llvm::DGNode< NodeType, EdgeType >::back ( )
inline

Definition at line 101 of file DirectedGraph.h.

◆ begin() [1/2]

template<class NodeType, class EdgeType>
const_iterator llvm::DGNode< NodeType, EdgeType >::begin ( ) const
inline

◆ begin() [2/2]

template<class NodeType, class EdgeType>
iterator llvm::DGNode< NodeType, EdgeType >::begin ( )
inline

Definition at line 96 of file DirectedGraph.h.

◆ clear()

template<class NodeType, class EdgeType>
void llvm::DGNode< NodeType, EdgeType >::clear ( )
inline

Clear the outgoing edges.

Definition at line 135 of file DirectedGraph.h.

◆ end() [1/2]

template<class NodeType, class EdgeType>
const_iterator llvm::DGNode< NodeType, EdgeType >::end ( ) const
inline

◆ end() [2/2]

template<class NodeType, class EdgeType>
iterator llvm::DGNode< NodeType, EdgeType >::end ( )
inline

Definition at line 97 of file DirectedGraph.h.

◆ findEdgesTo()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::findEdgesTo ( const NodeType &  N,
SmallVectorImpl< EdgeType *> &  EL 
) const
inline

Collect in EL, all the edges from this node to N.

Return true if at least one edge was found, and false otherwise. Note that this implementation allows more than one edge to connect a given pair of nodes.

Definition at line 107 of file DirectedGraph.h.

References assert(), E, llvm::SmallVectorBase::empty(), N, and llvm::SmallVectorTemplateBase< T >::push_back().

◆ findEdgeTo()

template<class NodeType, class EdgeType>
const_iterator llvm::DGNode< NodeType, EdgeType >::findEdgeTo ( const NodeType &  N) const
inlineprotected

Find an edge to N.

If more than one edge exists, this will return the first one in the list of edges.

Definition at line 149 of file DirectedGraph.h.

References E, llvm::find_if(), and N.

◆ front() [1/2]

template<class NodeType, class EdgeType>
const EdgeType& llvm::DGNode< NodeType, EdgeType >::front ( ) const
inline

Definition at line 98 of file DirectedGraph.h.

◆ front() [2/2]

template<class NodeType, class EdgeType>
EdgeType& llvm::DGNode< NodeType, EdgeType >::front ( )
inline

Definition at line 99 of file DirectedGraph.h.

◆ getDerived() [1/2]

template<class NodeType, class EdgeType>
NodeType& llvm::DGNode< NodeType, EdgeType >::getDerived ( )
inlineprotected

Definition at line 142 of file DirectedGraph.h.

◆ getDerived() [2/2]

template<class NodeType, class EdgeType>
const NodeType& llvm::DGNode< NodeType, EdgeType >::getDerived ( ) const
inlineprotected

Definition at line 143 of file DirectedGraph.h.

◆ getEdges() [1/2]

template<class NodeType, class EdgeType>
const EdgeListTy& llvm::DGNode< NodeType, EdgeType >::getEdges ( ) const
inline

Retrieve the outgoing edges for the node.

Definition at line 128 of file DirectedGraph.h.

Referenced by llvm::operator<<().

◆ getEdges() [2/2]

template<class NodeType, class EdgeType>
EdgeListTy& llvm::DGNode< NodeType, EdgeType >::getEdges ( )
inline

Definition at line 129 of file DirectedGraph.h.

References llvm::DGNode< NodeType, EdgeType >::Edges.

◆ hasEdgeTo()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::hasEdgeTo ( const NodeType &  N) const
inline

Test whether there is an edge that goes from this node to N.

Definition at line 123 of file DirectedGraph.h.

◆ isEqualTo()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::isEqualTo ( const NodeType &  N) const
inlineprotected

Definition at line 139 of file DirectedGraph.h.

References N.

◆ operator!=()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::operator!= ( const NodeType &  N) const
inline

Definition at line 92 of file DirectedGraph.h.

References llvm::DGEdge< NodeType, EdgeType >::operator==().

◆ operator=() [1/2]

template<class NodeType, class EdgeType>
DGNode<NodeType, EdgeType>& llvm::DGNode< NodeType, EdgeType >::operator= ( const DGNode< NodeType, EdgeType > &  N)
inline

Definition at line 80 of file DirectedGraph.h.

References llvm::DGNode< NodeType, EdgeType >::Edges.

Referenced by llvm::DDGNode::operator=().

◆ operator=() [2/2]

template<class NodeType, class EdgeType>
DGNode<NodeType, EdgeType>& llvm::DGNode< NodeType, EdgeType >::operator= ( const DGNode< NodeType, EdgeType > &&  N)
inline

Definition at line 84 of file DirectedGraph.h.

References N.

◆ operator==()

template<class NodeType, class EdgeType>
bool llvm::DGNode< NodeType, EdgeType >::operator== ( const NodeType &  N) const
inline

Static polymorphism: delegate implementation (via isEqualTo) to the derived class.

Definition at line 91 of file DirectedGraph.h.

References llvm::DGEdge< NodeType, EdgeType >::getDerived().

◆ removeEdge()

template<class NodeType, class EdgeType>
void llvm::DGNode< NodeType, EdgeType >::removeEdge ( EdgeType &  E)
inline

Remove the given edge E from this node, if it exists.

Definition at line 120 of file DirectedGraph.h.

Member Data Documentation

◆ Edges

template<class NodeType, class EdgeType>
EdgeListTy llvm::DGNode< NodeType, EdgeType >::Edges
protected

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