forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsymtable.mli
96 lines (80 loc) · 3.42 KB
/
symtable.mli
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(* Assign locations and numbers to globals and primitives *)
open Cmo_format
module Compunit : sig
type t = compunit
val name : t -> string
val is_packed : compunit -> bool
val to_ident : compunit -> Ident.t
module Set : Set.S with type elt = t
module Map : Map.S with type key = t
end
module Predef : sig
type t = predef
module Set : Set.S with type elt = t
module Map : Map.S with type key = t
end
module Global : sig
type t =
| Glob_compunit of compunit
| Glob_predef of predef
val name: t -> string
val description: t Format_doc.printer
val of_ident: Ident.t -> t option
module Set : Set.S with type elt = t
module Map : Map.S with type key = t
end
(* Functions for batch linking *)
val init: unit -> unit
val patch_object:
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t ->
(reloc_info * int) list -> unit
val require_primitive: string -> unit
val initial_global_table: unit -> Obj.t array
val output_global_map: out_channel -> unit
val output_primitive_names: out_channel -> unit
val output_primitive_table: out_channel -> unit
val data_global_map: unit -> Obj.t
val data_primitive_names: unit -> string list
val transl_const: Lambda.structured_constant -> Obj.t
(* Functions for the toplevel *)
val init_toplevel: unit -> (string * Digest.t option) list
val update_global_table: unit -> unit
val get_global_value: Global.t -> Obj.t
val is_global_defined: Global.t -> bool
val assign_global_value: Global.t -> Obj.t -> unit
val get_global_position: Global.t -> int
val check_global_initialized: (reloc_info * int) list -> unit
val initialized_compunits: (reloc_info * int) list -> compunit list
val required_compunits: (reloc_info * int) list -> compunit list
type global_map
val empty_global_map: global_map
val current_state: unit -> global_map
val restore_state: global_map -> unit
val hide_additions: global_map -> unit
val filter_global_map: (Global.t -> bool) -> global_map -> global_map
val iter_global_map : (Global.t -> int -> unit) -> global_map -> unit
val is_defined_in_global_map: global_map -> Global.t -> bool
(* Error report *)
type error =
Undefined_global of Global.t
| Unavailable_primitive of string
| Wrong_vm of string
| Uninitialized_global of Global.t
exception Error of error
val report_error: error Format_doc.format_printer
val report_error_doc: error Format_doc.printer
val reset: unit -> unit