Module Cfg_with_layout
type layout = Label.t Oxcaml_utils.Doubly_linked_list.tval create : Cfg.t -> layout:Cfg_with_layout.layout -> Cfg_with_layout.tval cfg : Cfg_with_layout.t -> Cfg.tval layout : Cfg_with_layout.t -> Cfg_with_layout.layoutval set_layout : Cfg_with_layout.t -> Cfg_with_layout.layout -> unitval add_block : Cfg_with_layout.t -> Cfg.basic_block -> after:Label.t -> unitAdd to cfg, layout, and other data-structures that track labels.
val assign_blocks_to_section :
Cfg_with_layout.t ->
Label.t list ->
string ->
unitval get_section : Cfg_with_layout.t -> Label.t -> string optionval remove_blocks : Cfg_with_layout.t -> Label.Set.t -> unitRemove from cfg, layout, and other data-structures that track labels.
val is_trap_handler : Cfg_with_layout.t -> Label.t -> boolval save_as_dot :
?show_instr:bool ->
?show_exn:bool ->
?annotate_instr:
(Stdlib.Format.formatter ->
[ `Basic of Cfg.basic Cfg.instruction
| `Terminator of Cfg.terminator Cfg.instruction ] ->
unit)
list ->
?annotate_block:(Label.t -> string) ->
?annotate_block_end:(Stdlib.Format.formatter -> Cfg.basic_block -> unit) ->
?annotate_succ:(Label.t -> Label.t -> string) ->
?filename:string ->
Cfg_with_layout.t ->
string ->
unitval print_dot :
?show_instr:bool ->
?show_exn:bool ->
?annotate_instr:
(Stdlib.Format.formatter ->
[ `Basic of Cfg.basic Cfg.instruction
| `Terminator of Cfg.terminator Cfg.instruction ] ->
unit)
list ->
?annotate_block:(Label.t -> string) ->
?annotate_block_end:(Stdlib.Format.formatter -> Cfg.basic_block -> unit) ->
?annotate_succ:(Label.t -> Label.t -> string) ->
Stdlib.Format.formatter ->
Cfg_with_layout.t ->
unitval dump : Stdlib.Format.formatter -> Cfg_with_layout.t -> msg:string -> unitval reorder_blocks_random :
?random_state:Stdlib.Random.State.t ->
Cfg_with_layout.t ->
unitChange layout: randomly reorder the blocks, keeping the entry block first. This function is intended for testing and enabled by compiler flag "-reorder-blocks-random".
Side-effects random_state by repeated calls to Random.State.int and Random.State.bool.
val reorder_blocks :
comparator:(Label.t -> Label.t -> int) ->
Cfg_with_layout.t ->
unitval iter_blocks : Cfg_with_layout.t -> f:(Cfg.basic_block -> unit) -> unitval iter_instructions :
Cfg_with_layout.t ->
instruction:(Cfg.basic Cfg.instruction -> unit) ->
terminator:(Cfg.terminator Cfg.instruction -> unit) ->
unitval fold_instructions :
Cfg_with_layout.t ->
instruction:('a -> Cfg.basic Cfg.instruction -> 'a) ->
terminator:('a -> Cfg.terminator Cfg.instruction -> 'a) ->
init:'a ->
'aval insert_block :
Cfg_with_layout.t ->
Cfg.basic_instruction_list ->
after:Cfg.basic_block ->
before:Cfg.basic_block option ->
next_instruction_id:(unit -> InstructionId.t) ->
Cfg.basic_block list