module Ertltree:sig
..end
typeident =
string
uniquement pour les fonctions
typeregister =
Register.t
typelabel =
Label.t
type
instr =
| |
Econst of |
|||
| |
Eload of |
|||
| |
Estore of |
|||
| |
Emunop of |
|||
| |
Embinop of |
|||
| |
Emubranch of |
|||
| |
Embbranch of |
|||
| |
Egoto of |
|||
| |
Ecall of |
(* | l'entier est le nombre de paramètres passés dans des registres | *) |
| |
Ealloc_frame of |
|||
| |
Edelete_frame of |
|||
| |
Eget_param of |
(* |
| *) |
| |
Epush_param of |
|||
| |
Ereturn |
Les différentes instructions ERTL
typecfg =
instr Label.map
Un graphe de flot de contrôle est un dictionnaire associant à des étiquettes des instructions ERTL.
type
deffun = {
|
fun_name : |
|
fun_formals : |
|
fun_locals : |
|
fun_entry : |
|
fun_body : |
Une fonction ERTL.
type
file = {
|
funs : |
Un programme ERTL.
val succ : instr -> label list
successeurs dans le graphe
val def_use : instr -> register list * register list
calcul des définitions et utilisations de chaque instruction
val visit : (label -> instr -> unit) ->
cfg -> label -> unit
visite le graphe de flot de contrôle à partir d'une étiquette donnée
val print_instr : Stdlib.Format.formatter -> instr -> unit
val print_graph : Stdlib.Format.formatter -> cfg -> label -> unit
val print_deffun : Stdlib.Format.formatter -> deffun -> unit
val print_file : Stdlib.Format.formatter -> file -> unit