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:173

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:183

Parameters

NodeType& N

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

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

Parameters

const llvm::DirectedGraph::DGraphType& G

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

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

Parameters

llvm::DirectedGraph::DGraphType&& RHS

DirectedGraph<NodeType, EdgeType>()

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

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:217

Parameters

NodeType& N

NodeType& back()

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

const NodeType& back() const

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

llvm::DirectedGraph::const_iterator begin() const

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

llvm::DirectedGraph::iterator begin()

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

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:265

Parameters

NodeType& Src
NodeType& Dst
EdgeType& E

llvm::DirectedGraph::iterator end()

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

llvm::DirectedGraph::const_iterator end() const

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

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:226

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:207

Parameters

const NodeType& N

llvm::DirectedGraph::iterator findNode(
    const NodeType& N)

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

Parameters

const NodeType& N

NodeType& front()

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

const NodeType& front() const

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

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:243

Parameters

NodeType& N

size_t size() const

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