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

Methods

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)

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:177

Parameters

const llvm::DirectedGraph::DGraphType& G

DirectedGraph<NodeType, EdgeType>(
    llvm::DirectedGraph::DGraphType&& RHS)

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:178

Parameters

llvm::DirectedGraph::DGraphType&& RHS

DirectedGraph<NodeType, EdgeType>()

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:175

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()

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:195

const NodeType& back() const

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:194

llvm::DirectedGraph::const_iterator begin() const

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:188

llvm::DirectedGraph::iterator begin()

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:190

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()

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:191

llvm::DirectedGraph::const_iterator end() const

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:189

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

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)

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:204

Parameters

const NodeType& N

NodeType& front()

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:193

const NodeType& front() const

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:192

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

Declared at: llvm/include/llvm/ADT/DirectedGraph.h:197