jon.recoil.org

Module Cfg_with_layout

type t
type layout = Label.t Oxcaml_utils.Doubly_linked_list.t
val set_layout : Cfg_with_layout.t -> Cfg_with_layout.layout -> unit
val add_block : Cfg_with_layout.t -> Cfg.basic_block -> after:Label.t -> unit

Add to cfg, layout, and other data-structures that track labels.

val assign_blocks_to_section : Cfg_with_layout.t -> Label.t list -> string -> unit
val get_section : Cfg_with_layout.t -> Label.t -> string option
val remove_blocks : Cfg_with_layout.t -> Label.Set.t -> unit

Remove from cfg, layout, and other data-structures that track labels.

val is_trap_handler : Cfg_with_layout.t -> Label.t -> bool
val 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 -> unit
val 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 -> unit
val dump : Stdlib.Format.formatter -> Cfg_with_layout.t -> msg:string -> unit
val reorder_blocks_random : ?random_state:Stdlib.Random.State.t -> Cfg_with_layout.t -> unit

Change 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 -> unit
val iter_blocks : Cfg_with_layout.t -> f:(Cfg.basic_block -> unit) -> unit
val iter_instructions : Cfg_with_layout.t -> instruction:(Cfg.basic Cfg.instruction -> unit) -> terminator:(Cfg.terminator Cfg.instruction -> unit) -> unit
val fold_instructions : Cfg_with_layout.t -> instruction:('a -> Cfg.basic Cfg.instruction -> 'a) -> terminator:('a -> Cfg.terminator Cfg.instruction -> 'a) -> init:'a -> 'a
val 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