1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
1995-07-02 09:41:48 -07:00
|
|
|
(* Compilation environments for compilation units *)
|
|
|
|
|
|
|
|
open Clambda
|
2010-05-19 04:29:38 -07:00
|
|
|
open Cmx_format
|
2000-03-09 01:12:28 -08:00
|
|
|
|
2005-08-01 08:51:09 -07:00
|
|
|
val reset: ?packname:string -> string -> unit
|
1995-07-02 09:41:48 -07:00
|
|
|
(* Reset the environment and record the name of the unit being
|
2005-08-01 08:51:09 -07:00
|
|
|
compiled (arg). Optional argument is [-for-pack] prefix. *)
|
|
|
|
|
|
|
|
val current_unit_infos: unit -> unit_infos
|
|
|
|
(* Return the infos for the unit being compiled *)
|
1995-07-02 09:41:48 -07:00
|
|
|
|
|
|
|
val current_unit_name: unit -> string
|
|
|
|
(* Return the name of the unit being compiled *)
|
|
|
|
|
2004-01-05 12:26:19 -08:00
|
|
|
val make_symbol: ?unitname:string -> string option -> string
|
|
|
|
(* [make_symbol ~unitname:u None] returns the asm symbol that
|
|
|
|
corresponds to the compilation unit [u] (default: the current unit).
|
|
|
|
[make_symbol ~unitname:u (Some id)] returns the asm symbol that
|
|
|
|
corresponds to symbol [id] in the compilation unit [u]
|
|
|
|
(or the current unit). *)
|
|
|
|
|
2005-08-01 08:51:09 -07:00
|
|
|
val symbol_for_global: Ident.t -> string
|
|
|
|
(* Return the asm symbol that refers to the given global identifier *)
|
|
|
|
|
1995-07-02 09:41:48 -07:00
|
|
|
val global_approx: Ident.t -> Clambda.value_approximation
|
|
|
|
(* Return the approximation for the given global identifier *)
|
|
|
|
val set_global_approx: Clambda.value_approximation -> unit
|
|
|
|
(* Record the approximation of the unit being compiled *)
|
2007-11-06 07:16:56 -08:00
|
|
|
val record_global_approx_toplevel: unit -> unit
|
|
|
|
(* Record the current approximation for the current toplevel phrase *)
|
|
|
|
|
1995-07-02 09:41:48 -07:00
|
|
|
|
|
|
|
val need_curry_fun: int -> unit
|
|
|
|
val need_apply_fun: int -> unit
|
2004-05-26 04:10:52 -07:00
|
|
|
val need_send_fun: int -> unit
|
|
|
|
(* Record the need of a currying (resp. application,
|
|
|
|
message sending) function with the given arity *)
|
1995-07-02 09:41:48 -07:00
|
|
|
|
2011-03-29 00:58:53 -07:00
|
|
|
val new_const_symbol : unit -> string
|
|
|
|
val new_const_label : unit -> int
|
|
|
|
val new_structured_constant : Lambda.structured_constant -> bool -> string
|
|
|
|
val structured_constants : unit -> (string * bool * Lambda.structured_constant) list
|
2007-11-06 07:16:56 -08:00
|
|
|
|
1995-10-09 06:37:11 -07:00
|
|
|
val read_unit_info: string -> unit_infos * Digest.t
|
1995-07-11 11:03:29 -07:00
|
|
|
(* Read infos and CRC from a [.cmx] file. *)
|
2002-02-08 08:55:44 -08:00
|
|
|
val write_unit_info: unit_infos -> string -> unit
|
|
|
|
(* Save the given infos in the given file *)
|
1995-07-02 09:41:48 -07:00
|
|
|
val save_unit_info: string -> unit
|
|
|
|
(* Save the infos for the current unit in the given file *)
|
2006-10-17 05:33:58 -07:00
|
|
|
val cache_unit_info: unit_infos -> unit
|
|
|
|
(* Enter the given infos in the cache. The infos will be
|
|
|
|
honored by [symbol_for_global] and [global_approx]
|
|
|
|
without looking at the corresponding .cmx file. *)
|
1995-07-02 09:41:48 -07:00
|
|
|
|
1995-11-09 05:21:49 -08:00
|
|
|
val cmx_not_found_crc: Digest.t
|
|
|
|
(* Special digest used in the [ui_imports_cmx] list to signal
|
|
|
|
that no [.cmx] file was found and used for the imported unit *)
|
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
val read_library_info: string -> library_infos
|
|
|
|
|
1995-07-02 09:41:48 -07:00
|
|
|
type error =
|
|
|
|
Not_a_unit_info of string
|
|
|
|
| Corrupted_unit_info of string
|
|
|
|
| Illegal_renaming of string * string
|
|
|
|
|
|
|
|
exception Error of error
|
|
|
|
|
2000-04-21 01:13:22 -07:00
|
|
|
val report_error: Format.formatter -> error -> unit
|