class DirectedGraph
Declaration
template <class NodeType, class EdgeType>
class DirectedGraph { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:166
Templates
- NodeType
- EdgeType
Member Variables
- protected llvm::DirectedGraph::NodeListTy Nodes
Method Overview
- public DirectedGraph<NodeType, EdgeType>(NodeType & N)
- public DirectedGraph<NodeType, EdgeType>(const llvm::DirectedGraph::DGraphType & G)
- public DirectedGraph<NodeType, EdgeType>(llvm::DirectedGraph::DGraphType && RHS)
- public DirectedGraph<NodeType, EdgeType>()
- public bool addNode(NodeType & N)
- public NodeType & back()
- public const NodeType & back() const
- public llvm::DirectedGraph::const_iterator begin() const
- public llvm::DirectedGraph::iterator begin()
- public bool connect(NodeType & Src, NodeType & Dst, EdgeType & E)
- public llvm::DirectedGraph::iterator end()
- public llvm::DirectedGraph::const_iterator end() const
- public bool findIncomingEdgesToNode(const NodeType & N, SmallVectorImpl<EdgeType *> & EL) const
- public llvm::DirectedGraph::const_iterator findNode(const NodeType & N) const
- public llvm::DirectedGraph::iterator findNode(const NodeType & N)
- public NodeType & front()
- public const NodeType & front() const
- public bool removeNode(NodeType & N)
- public size_t size() const
Methods
¶DirectedGraph<NodeType, EdgeType>(NodeType& N)
DirectedGraph<NodeType, EdgeType>(NodeType& N)
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:176
Parameters
- NodeType& N
¶DirectedGraph<NodeType, EdgeType>(
const llvm::DirectedGraph::DGraphType& G)
DirectedGraph<NodeType, EdgeType>(
const llvm::DirectedGraph::DGraphType& G)
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:177
Parameters
- const llvm::DirectedGraph::DGraphType& G
¶DirectedGraph<NodeType, EdgeType>(
llvm::DirectedGraph::DGraphType&& RHS)
DirectedGraph<NodeType, EdgeType>(
llvm::DirectedGraph::DGraphType&& RHS)
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:178
Parameters
¶DirectedGraph<NodeType, EdgeType>()
DirectedGraph<NodeType, EdgeType>()
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:175
¶bool addNode(NodeType& N)
bool addNode(NodeType& N)
Description
Add the given node \p N to the graph if it is not already present.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:210
Parameters
- NodeType& N
¶NodeType& back()
NodeType& back()
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:195
¶const NodeType& back() const
const NodeType& back() const
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:194
¶llvm::DirectedGraph::const_iterator begin() const
llvm::DirectedGraph::const_iterator begin() const
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:188
¶llvm::DirectedGraph::iterator begin()
llvm::DirectedGraph::iterator begin()
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:190
¶bool connect(NodeType& Src,
NodeType& Dst,
EdgeType& E)
bool connect(NodeType& Src,
NodeType& Dst,
EdgeType& E)
Description
Assuming nodes \p Src and \p Dst are already in the graph, connect node \p Src to node \p Dst using the provided edge \p E. Return true if \p Src is not already connected to \p Dst via \p E, and false otherwise.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:258
Parameters
- NodeType& Src
- NodeType& Dst
- EdgeType& E
¶llvm::DirectedGraph::iterator end()
llvm::DirectedGraph::iterator end()
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:191
¶llvm::DirectedGraph::const_iterator end() const
llvm::DirectedGraph::const_iterator end() const
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:189
¶bool findIncomingEdgesToNode(
const NodeType& N,
SmallVectorImpl<EdgeType*>& EL) const
bool findIncomingEdgesToNode(
const NodeType& N,
SmallVectorImpl<EdgeType*>& EL) const
Description
Collect in \p EL all edges that are coming into node \p N. Return true if at least one edge was found, and false otherwise.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:219
Parameters
- const NodeType& N
- SmallVectorImpl<EdgeType*>& EL
¶llvm::DirectedGraph::const_iterator findNode(
const NodeType& N) const
llvm::DirectedGraph::const_iterator findNode(
const NodeType& N) const
Description
Find the given node \p N in the table.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:200
Parameters
- const NodeType& N
¶llvm::DirectedGraph::iterator findNode(
const NodeType& N)
llvm::DirectedGraph::iterator findNode(
const NodeType& N)
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:204
Parameters
- const NodeType& N
¶NodeType& front()
NodeType& front()
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:193
¶const NodeType& front() const
const NodeType& front() const
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:192
¶bool removeNode(NodeType& N)
bool removeNode(NodeType& N)
Description
Remove the given node \p 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.
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:236
Parameters
- NodeType& N
¶size_t size() const
size_t size() const
Declared at: llvm/include/llvm/ADT/DirectedGraph.h:197