File: structure.mli

package info (click to toggle)
js-of-ocaml 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 37,932 kB
  • sloc: ml: 135,957; javascript: 58,364; ansic: 437; makefile: 422; sh: 12; perl: 4
file content (30 lines) | stat: -rw-r--r-- 721 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
open! Stdlib
open Code

type graph

type t

val get_edges : graph -> Addr.t -> Addr.Set.t

val is_backward : t -> Addr.t -> Addr.t -> bool

val is_forward : t -> Addr.t -> Addr.t -> bool

val build_graph : block Addr.Map.t -> Addr.t -> t

val dominator_tree : t -> graph

val is_merge_node : t -> Addr.t -> bool

val is_loop_header : t -> Addr.t -> bool

val sort_in_post_order : t -> Addr.t list -> Addr.t list

val blocks_in_reverse_post_order : t -> Code.Addr.t list

val get_nodes : t -> Addr.Set.t

val norm : program -> program
(** [norm p] normalizes a program [p] to accommodate [Structure.build_graph] logic.
    In practice, it ensures that all loops have a predecessor block and allows to exit loops early. *)