package libsail

  1. Overview
  2. Docs
val optimize_unit : Jib.instr list -> Jib.instr list

Remove redundant assignments and variables of type unit. unit-typed identifiers that are assigned to are replaced with CL_void, and cvals (which should be pure!) are replaced with unit types are replaced by unit-literals.

val flatten_instrs : Jib.instr list -> Jib.instr list

Remove all instructions that can contain other nested instructions, prodcing a flat list of instructions.

val flatten_cdef : Jib.cdef -> Jib.cdef
val reset_flat_counter : unit -> unit
val unique_per_function_ids : Jib.cdef list -> Jib.cdef list
val inline : Jib.cdef list -> (Ast.id -> bool) -> Jib.instr list -> Jib.instr list
val remove_undefined : Jib.instr list -> Jib.instr list
val remove_clear : Jib.instr list -> Jib.instr list
val remove_pointless_goto : Jib.instr list -> Jib.instr list

Remove gotos immediately followed by the label it jumps to

val remove_unused_labels : Jib.instr list -> Jib.instr list
val remove_dead_after_goto : Jib.instr list -> Jib.instr list
val remove_dead_code : Jib.instr list -> Jib.instr list
val remove_tuples : Jib.cdef list -> Jib_compile.ctx -> Jib.cdef list * Jib_compile.ctx
val structure_control_flow_block : Jib.instr list -> Jib.instr list
OCaml

Innovation. Community. Security.