package libsail
Module Libsail.Jib_ssaSource
A mutable array based graph type, with nodes indexed by integers.
Create an empty array_graph, specifying the initial size of the underlying array.
Add a vertex to a graph, returning the index of the inserted vertex. If the number of vertices exceeds the size of the underlying array, then it is dynamically resized.
Add an edge between two existing vertices. Raises Invalid_argument if either of the vertices do not exist.
type cf_node = | CF_label of string| CF_block of Jib.instr list * terminator| CF_guard of int| CF_start of Jib.ctyp Jib_util.NameMap.t| CF_end
immediate_dominators graph root will calculate the immediate dominators for a control flow graph with a specified root node.
val variable_dependencies :
(ssa_elem list * cf_node) array_graph ->
NameGraph.graph * int Jib_util.NameMap.tReturn a graph of variable dependencies (from writes to reads). The second element of the return tuple is the node containing the variable declaration.
val ssa :
?globals:Jib_util.NameSet.t ->
?debug_prefix:string ->
Jib.instr list ->
int * int * (ssa_elem list * cf_node) array_graphConvert a list of instructions into SSA form
Output the control-flow graph in graphviz format for debugging. Can use 'dot -Tpng X.gv -o X.png' to generate a png image of the graph.
val make_dominators_dot :
out_channel ->
int array ->
(ssa_elem list * cf_node) array_graph ->
unit