ControlFlowGraph
struct ControlFlowGraph : Sendable
extension ControlFlowGraph: CustomStringConvertible
A control-flow graph.
This data structure describes relation between the basic blocks of a function. The direction of
the graph’s edges denotes the direction of the control flow from one block to another: there an
edge from A to B if the former’s terminator points to the latter.
-
A node in the graph.
Declaration
Swift
typealias Vertex = Function.Blocks.Address -
An control edge label.
See moreDeclaration
Swift
enum Label : Sendable -
The way a control-flow relation is represented internally.
-
The relation encoded by the graph.
Declaration
Swift
private var relation: Relation -
Creates an empty control flow graph.
Declaration
Swift
init() -
Defines
sourceas a predecessor oftarget. -
Removes
sourcefrom the predecessors oftarget. -
Returns the successors of
source. -
Returns the predecessors of
target. -
A collection where the vertex at index
i + 1is predecessor of the vertex at indexi.Declaration
Swift
typealias PredecessorPath = [Vertex] -
Returns the paths originating at
ancestorand reachingdestinationexcluding those that containdestination.Declaration
Swift
func paths(to destination: Vertex, from ancestor: Vertex) -> [PredecessorPath] -
Returns the paths originating at
ancestorand reachingdestinationexcluding those that contain the vertices invisited.Declaration
Swift
private func paths( to destination: Vertex, from ancestor: Vertex, notContaining visited: inout Set<Vertex>, cachingResultsTo cache: inout [Vertex: [PredecessorPath]] ) -> [PredecessorPath] -
The Graphviz (dot) representation of the graph.
Declaration
Swift
var description: String { get }
View on GitHub