LLVM 22.0.0git
|
Directed graph. More...
#include "llvm/ADT/DirectedGraph.h"
Public Types | |
using | iterator = typename NodeListTy::iterator |
using | const_iterator = typename NodeListTy::const_iterator |
using | DGraphType = DirectedGraph<NodeType, EdgeType> |
Public Member Functions | |
DirectedGraph ()=default | |
DirectedGraph (NodeType &N) | |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
const NodeType & | front () const |
NodeType & | front () |
const NodeType & | back () const |
NodeType & | back () |
size_t | size () const |
const_iterator | findNode (const NodeType &N) const |
Find the given node N in the table. | |
iterator | findNode (const NodeType &N) |
bool | addNode (NodeType &N) |
Add the given node N to the graph if it is not already present. | |
bool | findIncomingEdgesToNode (const NodeType &N, SmallVectorImpl< EdgeType * > &EL) const |
Collect in EL all edges that are coming into node N . | |
bool | removeNode (NodeType &N) |
Remove the given node N from the graph. | |
bool | connect (NodeType &Src, NodeType &Dst, EdgeType &E) |
Assuming nodes Src and Dst are already in the graph, connect node Src to node Dst using the provided edge E . |
Protected Types | |
using | NodeListTy = SmallVector<NodeType *, 10> |
using | EdgeListTy = SmallVector<EdgeType *, 10> |
Protected Attributes | |
NodeListTy | Nodes |
Directed graph.
The graph is represented by a table of nodes. Each node contains a (possibly empty) list of outgoing edges. Each edge contains the target node it connects to.
Definition at line 173 of file DirectedGraph.h.
using llvm::DirectedGraph< NodeType, EdgeType >::const_iterator = typename NodeListTy::const_iterator |
Definition at line 179 of file DirectedGraph.h.
using llvm::DirectedGraph< NodeType, EdgeType >::DGraphType = DirectedGraph<NodeType, EdgeType> |
Definition at line 180 of file DirectedGraph.h.
|
protected |
Definition at line 176 of file DirectedGraph.h.
using llvm::DirectedGraph< NodeType, EdgeType >::iterator = typename NodeListTy::iterator |
Definition at line 178 of file DirectedGraph.h.
|
protected |
Definition at line 175 of file DirectedGraph.h.
|
default |
|
inlineexplicit |
Definition at line 183 of file DirectedGraph.h.
|
inline |
Add the given node N
to the graph if it is not already present.
Definition at line 207 of file DirectedGraph.h.
Referenced by llvm::DirectedGraph< DDGNode, DDGEdge >::DirectedGraph().
|
inline |
Definition at line 192 of file DirectedGraph.h.
|
inline |
Definition at line 191 of file DirectedGraph.h.
|
inline |
Definition at line 187 of file DirectedGraph.h.
|
inline |
Definition at line 185 of file DirectedGraph.h.
Referenced by llvm::GraphTraits< const DataDependenceGraph * >::nodes_begin(), and llvm::GraphTraits< DataDependenceGraph * >::nodes_begin().
|
inline |
Assuming nodes Src
and Dst
are already in the graph, connect node Src
to node Dst
using the provided edge E
.
Return true if Src
is not already connected to Dst
via E
, and false otherwise.
Definition at line 255 of file DirectedGraph.h.
|
inline |
Definition at line 188 of file DirectedGraph.h.
|
inline |
Definition at line 186 of file DirectedGraph.h.
Referenced by llvm::GraphTraits< const DataDependenceGraph * >::nodes_end(), and llvm::GraphTraits< DataDependenceGraph * >::nodes_end().
|
inline |
Collect in EL
all edges that are coming into node N
.
Return true if at least one edge was found, and false otherwise.
Definition at line 216 of file DirectedGraph.h.
|
inline |
Definition at line 201 of file DirectedGraph.h.
|
inline |
Find the given node N
in the table.
Definition at line 197 of file DirectedGraph.h.
Referenced by llvm::DirectedGraph< DDGNode, DDGEdge >::addNode(), llvm::DirectedGraph< DDGNode, DDGEdge >::connect(), and llvm::DirectedGraph< DDGNode, DDGEdge >::removeNode().
|
inline |
Definition at line 190 of file DirectedGraph.h.
|
inline |
Definition at line 189 of file DirectedGraph.h.
|
inline |
Remove the given node N
from the graph.
If the node has incoming or outgoing edges, they are also removed. Return true if the node was found and then removed, and false if the node was not found in the graph to begin with.
Definition at line 233 of file DirectedGraph.h.
|
inline |
Definition at line 194 of file DirectedGraph.h.
|
protected |
Definition at line 265 of file DirectedGraph.h.