1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* Generation of bytecode for .cmo files *)
17
18 open Cmo_format
19 open Instruct
20
21 val to_file: out_channel -> string -> string ->
22 required_globals:Ident.Set.t -> instruction list -> unit
23 (* Arguments:
24 channel on output file
25 name of compilation unit implemented
26 path of cmo file being written
27 required_globals: list of compilation units that must be
28 evaluated before this one
29 list of instructions to emit *)
30 val to_memory:
31 instruction list -> instruction list ->
32 Misc.LongString.t * (reloc_info * int) list * debug_event list
33 (* Arguments:
34 initialization code (terminated by STOP)
35 function code
36 Results:
37 block of relocatable bytecode
38 relocation information
39 debug events *)
40 val to_packed_file:
41 out_channel -> instruction list -> (reloc_info * int) list
42 (* Arguments:
43 channel on output file
44 list of instructions to emit
45 Result:
46 relocation information (reversed) *)
47
48 val reset: unit -> unit
49
50 val marshal_to_channel_with_possibly_32bit_compat :
51 filename:string -> kind:string -> out_channel -> 'a -> unit
52