48 lines | 2424 chars
1 | (**************************************************************************) |
2 | (* *) |
3 | (* OCaml *) |
4 | (* *) |
5 | (* Pierre Chambart, OCamlPro *) |
6 | (* Mark Shinwell and Leo White, Jane Street Europe *) |
7 | (* *) |
8 | (* Copyright 2013--2016 OCamlPro SAS *) |
9 | (* Copyright 2014--2016 Jane Street Group LLC *) |
10 | (* *) |
11 | (* All rights reserved. This file is distributed under the terms of *) |
12 | (* the GNU Lesser General Public License version 2.1, with the *) |
13 | (* special exception on linking described in the file LICENSE. *) |
14 | (* *) |
15 | (**************************************************************************) |
16 | |
17 | [@@@ocaml.warning "+a-4-9-30-40-41-42"] |
18 | |
19 | (** Knowledge that the middle end needs about the backend. *) |
20 | |
21 | module type S = sig |
22 | (** Compute the symbol for the given identifier. *) |
23 | val symbol_for_global' : (Ident.t -> Symbol.t) |
24 | |
25 | (** If the given approximation is that of a symbol (Value_symbol) or an |
26 | external (Value_extern), attempt to find a more informative |
27 | approximation from a previously-written compilation artifact. In the |
28 | native code backend, for example, this might consult a .cmx file. *) |
29 | val really_import_approx : Simple_value_approx.t -> Simple_value_approx.t |
30 | |
31 | val import_symbol : Symbol.t -> Simple_value_approx.t |
32 | |
33 | val closure_symbol : Closure_id.t -> Symbol.t |
34 | |
35 | (** The natural size of an integer on the target architecture |
36 | (cf. [Arch.size_int] in the native code backend). *) |
37 | val size_int : int |
38 | |
39 | (** [true] iff the target architecture is big endian. *) |
40 | val big_endian : bool |
41 | |
42 | (** The maximum number of arguments that is reasonable for a function |
43 | to have. This should be fewer than the threshold that causes non-self |
44 | tail call optimization to be inhibited (in particular, if it would |
45 | entail passing arguments on the stack; see [Selectgen]). *) |
46 | val max_sensible_number_of_arguments : int |
47 | end |
48 |