2 (** This module is the central part of the translation of [ERTL]
3 programs into [LTL] programs. *)
5 (* Pasted from Pottier's PP compiler *)
7 (* This module translates [ERTL] statements into [LTL] statements. It is
8 parameterized over a module [Env], whose signature appears below, which
9 provides support for mapping pseudo-registers to stack slots or hardware
10 registers and for generating instructions (which requires allocating fresh
11 control flow graph labels). *)
14 | Spill of AST.immediate
15 | Color of I8051.register
17 module Make (Env : sig
19 val lookup: Register.t -> decision
21 (* [generate instruction] returns a fresh instruction label, which
22 it associates with [instruction] in the control flow graph. *)
24 val generate: LTL.statement -> Label.t
26 val fresh_label: unit -> Label.t
28 val add_graph: Label.t -> LTL.statement -> unit
36 (* [translate_statement] turns a [ERTL] statement into a [LTL] statement, or
37 sequence of statements, that transfers control to the same label(s).
39 Existing statement labels are preserved, that is, the labels in
40 the new control flow graph form a superset of the labels in the
41 existing control flow graph. *)
43 val translate_statement: ERTL.statement -> LTL.statement