package libsail

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Libsail.Jib_ssaSource

Sourceval ssa_name : int -> Jib.name -> Jib.name
Sourceval unssa_name : Jib.name -> Jib.name * int
Sourcetype 'a array_graph

A mutable array based graph type, with nodes indexed by integers.

Sourceval make : initial_size:int -> unit -> 'a array_graph

Create an empty array_graph, specifying the initial size of the underlying array.

Sourcemodule IntSet = Util.IntSet
Sourceval get_cond : 'a array_graph -> int -> Jib.cval
Sourceval get_vertex : 'a array_graph -> int -> ('a * IntSet.t * IntSet.t) option
Sourceval iter_graph : ('a -> IntSet.t -> IntSet.t -> unit) -> 'a array_graph -> unit
Sourceval add_vertex : 'a -> 'a array_graph -> int

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.

Sourceval add_edge : int -> int -> 'a array_graph -> unit

Add an edge between two existing vertices. Raises Invalid_argument if either of the vertices do not exist.

Sourceexception Not_a_DAG of int
Sourceval topsort : 'a array_graph -> int list
Sourcetype terminator =
  1. | T_undefined of Jib.ctyp
  2. | T_exit of string
  3. | T_end of Jib.name
  4. | T_goto of string
  5. | T_jump of int * string
  6. | T_label of string
  7. | T_none
Sourcetype cf_node =
  1. | CF_label of string
  2. | CF_block of Jib.instr list * terminator
  3. | CF_guard of int
  4. | CF_start of Jib.ctyp Jib_util.NameMap.t
  5. | CF_end
Sourceval control_flow_graph : Jib.instr list -> int * int * ('a list * cf_node) array_graph
Sourceval immediate_dominators : ?post:bool -> 'a array_graph -> int -> int array

immediate_dominators graph root will calculate the immediate dominators for a control flow graph with a specified root node.

Sourcetype ssa_elem =
  1. | Phi of Jib.name * Jib.ctyp * Jib.name list
  2. | Pi of Jib.cval list
Sourcemodule NameGraph : sig ... end
Sourceval phi_dependencies : (ssa_elem list * cf_node) array_graph -> NameGraph.graph * int Jib_util.NameMap.t
Sourceval ssa : ?globals:Jib_util.NameSet.t -> ?debug_prefix:string -> Jib.instr list -> int * int * (ssa_elem list * cf_node) array_graph

Convert a list of instructions into SSA form

Sourceval make_dot : out_channel -> (ssa_elem list * cf_node) array_graph -> unit

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.

Sourceval make_dominators_dot : out_channel -> int array -> (ssa_elem list * cf_node) array_graph -> unit
OCaml

Innovation. Community. Security.