LLVM 20.0.0git
|
Represent a node in the directed graph. More...
#include "llvm/ADT/DirectedGraph.h"
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 . | |
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) |
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 . | |
bool | addEdge (EdgeType &E) |
Add the given edge E to this node, if it doesn't exist already. | |
void | removeEdge (EdgeType &E) |
Remove the given edge E from this node, if it exists. | |
bool | hasEdgeTo (const NodeType &N) const |
Test whether there is an edge that goes from this node to N . | |
const EdgeListTy & | getEdges () const |
Retrieve the outgoing edges for the node. | |
EdgeListTy & | getEdges () |
void | clear () |
Clear the outgoing edges. | |
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 . | |
Protected Attributes | |
EdgeListTy | Edges |
Friends | |
bool | operator== (const NodeType &M, const NodeType &N) |
Static polymorphism: delegate implementation (via isEqualTo) to the derived class. | |
bool | operator!= (const NodeType &M, const NodeType &N) |
Represent a node in the directed graph.
The node has a (possibly empty) list of outgoing edges.
Definition at line 73 of file DirectedGraph.h.
using llvm::DGNode< NodeType, EdgeType >::const_iterator = typename EdgeListTy::const_iterator |
Definition at line 77 of file DirectedGraph.h.
using llvm::DGNode< NodeType, EdgeType >::EdgeListTy = SetVector<EdgeType *> |
Definition at line 75 of file DirectedGraph.h.
using llvm::DGNode< NodeType, EdgeType >::iterator = typename EdgeListTy::iterator |
Definition at line 76 of file DirectedGraph.h.
|
inlineexplicit |
Create a node with a single outgoing edge E
.
Definition at line 80 of file DirectedGraph.h.
References E, llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::insert().
|
default |
|
inlineexplicit |
Definition at line 83 of file DirectedGraph.h.
|
inline |
Definition at line 84 of file DirectedGraph.h.
|
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 127 of file DirectedGraph.h.
References E, llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::insert().
|
inline |
Definition at line 111 of file DirectedGraph.h.
References llvm::SetVector< T, Vector, Set, N >::back(), and llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Definition at line 110 of file DirectedGraph.h.
References llvm::SetVector< T, Vector, Set, N >::back(), and llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Definition at line 106 of file DirectedGraph.h.
References llvm::SetVector< T, Vector, Set, N >::begin(), and llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Definition at line 104 of file DirectedGraph.h.
References llvm::SetVector< T, Vector, Set, N >::begin(), and llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Clear the outgoing edges.
Definition at line 145 of file DirectedGraph.h.
References llvm::SetVector< T, Vector, Set, N >::clear(), and llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Definition at line 107 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::end().
|
inline |
Definition at line 105 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::end().
|
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 117 of file DirectedGraph.h.
References assert(), E, llvm::DGNode< NodeType, EdgeType >::Edges, llvm::SmallVectorBase< Size_T >::empty(), N, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
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 159 of file DirectedGraph.h.
References E, llvm::DGNode< NodeType, EdgeType >::Edges, llvm::find_if(), and N.
Referenced by llvm::DGNode< NodeType, EdgeType >::hasEdgeTo().
|
inline |
Definition at line 109 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::front().
|
inline |
Definition at line 108 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::front().
|
inlineprotected |
Definition at line 152 of file DirectedGraph.h.
|
inlineprotected |
Definition at line 153 of file DirectedGraph.h.
|
inline |
Definition at line 139 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Retrieve the outgoing edges for the node.
Definition at line 138 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges.
|
inline |
Test whether there is an edge that goes from this node to N
.
Definition at line 133 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, llvm::SetVector< T, Vector, Set, N >::end(), llvm::DGNode< NodeType, EdgeType >::findEdgeTo(), and N.
|
inlineprotected |
Definition at line 149 of file DirectedGraph.h.
References N.
|
inline |
Definition at line 90 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and N.
|
inline |
Definition at line 86 of file DirectedGraph.h.
References llvm::DGNode< NodeType, EdgeType >::Edges, and N.
Referenced by llvm::DDGNode::operator=().
|
inline |
Remove the given edge E
from this node, if it exists.
Definition at line 130 of file DirectedGraph.h.
References E, llvm::DGNode< NodeType, EdgeType >::Edges, and llvm::SetVector< T, Vector, Set, N >::remove().
|
friend |
Definition at line 100 of file DirectedGraph.h.
|
friend |
Static polymorphism: delegate implementation (via isEqualTo) to the derived class.
Definition at line 97 of file DirectedGraph.h.
|
protected |
Definition at line 165 of file DirectedGraph.h.
Referenced by llvm::DGNode< NodeType, EdgeType >::addEdge(), llvm::DGNode< NodeType, EdgeType >::back(), llvm::DGNode< NodeType, EdgeType >::begin(), llvm::DGNode< NodeType, EdgeType >::clear(), llvm::DGNode< NodeType, EdgeType >::DGNode(), llvm::DGNode< NodeType, EdgeType >::end(), llvm::DGNode< NodeType, EdgeType >::findEdgesTo(), llvm::DGNode< NodeType, EdgeType >::findEdgeTo(), llvm::DGNode< NodeType, EdgeType >::front(), llvm::DGNode< NodeType, EdgeType >::getEdges(), llvm::DGNode< NodeType, EdgeType >::hasEdgeTo(), llvm::DGNode< NodeType, EdgeType >::operator=(), and llvm::DGNode< NodeType, EdgeType >::removeEdge().