2 (** This module defines the instrumentation of a [Cminor] program. *)
5 (** [instrument prog cost_map] instruments the program [prog]. First a fresh
6 global variable --- the so-called cost variable --- is added to the program.
7 Then, each cost label in the program is replaced by an increment of the cost
8 variable, following the mapping [cost_map]. The function also returns the
9 name of the cost variable and the name of the cost increment function. *)
11 val instrument : Cminor.program -> int CostLabel.Map.t ->
12 Cminor.program * string * string
15 val cost_labels : Cminor.program -> CostLabel.Set.t
16 val user_labels : Cminor.program -> Label.Set.t
17 val all_labels : Cminor.program -> StringTools.Set.t
19 val prog_idents : Cminor.program -> StringTools.Set.t