1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Mark Shinwell, Jane Street Europe *)
6 (* *)
7 (* Copyright 2018 Jane Street Group LLC *)
8 (* *)
9 (* All rights reserved. This file is distributed under the terms of *)
10 (* the GNU Lesser General Public License version 2.1, with the *)
11 (* special exception on linking described in the file LICENSE. *)
12 (* *)
13 (**************************************************************************)
14
15 (** Variables used in the backend, optionally equipped with "provenance"
16 information, used for the emission of debugging information. *)
17
18 [@@@ocaml.warning "+a-4-30-40-41-42"]
19
20 include module type of struct include Ident end
21
22 type backend_var = t
23
24 module Provenance : sig
25 type t
26
27 val create
28 : module_path:Path.t
29 -> location:Debuginfo.t
30 -> original_ident:Ident.t
31 -> t
32
33 val module_path : t -> Path.t
34 val location : t -> Debuginfo.t
35 val original_ident : t -> Ident.t
36
37 val print : Format.formatter -> t -> unit
38 end
39
40 module With_provenance : sig
41 (** Values of type [t] should be used for variables in binding position. *)
42 type t
43
44 val print : Format.formatter -> t -> unit
45
46 val create : ?provenance:Provenance.t -> backend_var -> t
47
48 val var : t -> backend_var
49 val provenance : t -> Provenance.t option
50
51 val name : t -> string
52
53 val rename : t -> t
54 end
55