summaryrefslogtreecommitdiff
path: root/bytecomp
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2006-05-11 15:50:53 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2006-05-11 15:50:53 +0000
commit09921987cc807443c13b598ce5dccab6cc2bd74f (patch)
tree4753409042cf178cd974b731c129dbbe302f87d2 /bytecomp
parent7e41567e69cc6a219a51334c94da89c2fd9b52bd (diff)
downloadocaml-09921987cc807443c13b598ce5dccab6cc2bd74f.tar.gz
Deplacement des infos de format des .cmo et .cma dans Cmo_format
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp')
-rw-r--r--bytecomp/bytelibrarian.ml2
-rw-r--r--bytecomp/bytelink.ml2
-rw-r--r--bytecomp/bytelink.mli2
-rw-r--r--bytecomp/bytepackager.ml2
-rw-r--r--bytecomp/cmo_format.mli61
-rw-r--r--bytecomp/emitcode.ml32
-rw-r--r--bytecomp/emitcode.mli47
-rw-r--r--bytecomp/symtable.ml2
-rw-r--r--bytecomp/symtable.mli2
9 files changed, 69 insertions, 83 deletions
diff --git a/bytecomp/bytelibrarian.ml b/bytecomp/bytelibrarian.ml
index 1194fc1b39..a5d45877fc 100644
--- a/bytecomp/bytelibrarian.ml
+++ b/bytecomp/bytelibrarian.ml
@@ -16,7 +16,7 @@
open Misc
open Config
-open Emitcode
+open Cmo_format
type error =
File_not_found of string
diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
index 11321fca14..135ae2bc2e 100644
--- a/bytecomp/bytelink.ml
+++ b/bytecomp/bytelink.ml
@@ -18,7 +18,7 @@ open Sys
open Misc
open Config
open Instruct
-open Emitcode
+open Cmo_format
type error =
File_not_found of string
diff --git a/bytecomp/bytelink.mli b/bytecomp/bytelink.mli
index a92a95d27c..2e8f0cb313 100644
--- a/bytecomp/bytelink.mli
+++ b/bytecomp/bytelink.mli
@@ -16,7 +16,7 @@
val link: string list -> string -> unit
-val check_consistency: string -> Emitcode.compilation_unit -> unit
+val check_consistency: string -> Cmo_format.compilation_unit -> unit
val extract_crc_interfaces: unit -> (string * Digest.t) list
diff --git a/bytecomp/bytepackager.ml b/bytecomp/bytepackager.ml
index 57b8371a5b..4b1d9620ef 100644
--- a/bytecomp/bytepackager.ml
+++ b/bytecomp/bytepackager.ml
@@ -17,7 +17,7 @@
open Misc
open Instruct
-open Emitcode
+open Cmo_format
type error =
Forward_reference of string * Ident.t
diff --git a/bytecomp/cmo_format.mli b/bytecomp/cmo_format.mli
new file mode 100644
index 0000000000..34df9ffaea
--- /dev/null
+++ b/bytecomp/cmo_format.mli
@@ -0,0 +1,61 @@
+(***********************************************************************)
+(* *)
+(* Objective Caml *)
+(* *)
+(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2006 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id$ *)
+
+(* Symbol table information for .cmo and .cma files *)
+
+(* Relocation information *)
+
+type reloc_info =
+ Reloc_literal of Lambda.structured_constant (* structured constant *)
+ | Reloc_getglobal of Ident.t (* reference to a global *)
+ | Reloc_setglobal of Ident.t (* definition of a global *)
+ | Reloc_primitive of string (* C primitive number *)
+
+(* Descriptor for compilation units *)
+
+type compilation_unit =
+ { cu_name: string; (* Name of compilation unit *)
+ mutable cu_pos: int; (* Absolute position in file *)
+ cu_codesize: int; (* Size of code block *)
+ cu_reloc: (reloc_info * int) list; (* Relocation information *)
+ cu_imports: (string * Digest.t) list; (* Names and CRC of intfs imported *)
+ cu_primitives: string list; (* Primitives declared inside *)
+ mutable cu_force_link: bool; (* Must be linked even if unref'ed *)
+ mutable cu_debug: int; (* Position of debugging info, or 0 *)
+ cu_debugsize: int } (* Length of debugging info *)
+
+(* Format of a .cmo file:
+ magic number (Config.cmo_magic_number)
+ absolute offset of compilation unit descriptor
+ block of relocatable bytecode
+ debugging information if any
+ compilation unit descriptor *)
+
+(* Descriptor for libraries *)
+
+type library =
+ { lib_units: compilation_unit list; (* List of compilation units *)
+ lib_custom: bool; (* Requires custom mode linking? *)
+ lib_ccobjs: string list; (* C object files needed for -custom *)
+ lib_ccopts: string list; (* Extra opts to C compiler *)
+ lib_dllibs: string list } (* DLLs needed *)
+
+(* Format of a .cma file:
+ magic number (Config.cma_magic_number)
+ absolute offset of library descriptor
+ object code for first library member
+ ...
+ object code for last library member
+ library descriptor *)
+
diff --git a/bytecomp/emitcode.ml b/bytecomp/emitcode.ml
index bd56ca6425..d26fef75c7 100644
--- a/bytecomp/emitcode.ml
+++ b/bytecomp/emitcode.ml
@@ -20,37 +20,7 @@ open Asttypes
open Lambda
open Instruct
open Opcodes
-
-
-(* Relocation information *)
-
-type reloc_info =
- Reloc_literal of structured_constant (* structured constant *)
- | Reloc_getglobal of Ident.t (* reference to a global *)
- | Reloc_setglobal of Ident.t (* definition of a global *)
- | Reloc_primitive of string (* C primitive number *)
-
-(* Descriptor for compilation units *)
-
-type compilation_unit =
- { cu_name: string; (* Name of compilation unit *)
- mutable cu_pos: int; (* Absolute position in file *)
- cu_codesize: int; (* Size of code block *)
- cu_reloc: (reloc_info * int) list; (* Relocation information *)
- cu_imports: (string * Digest.t) list; (* Names and CRC of intfs imported *)
- cu_primitives: string list; (* Primitives declared inside *)
- mutable cu_force_link: bool; (* Must be linked even if unref'ed *)
- mutable cu_debug: int; (* Position of debugging info, or 0 *)
- cu_debugsize: int } (* Length of debugging info *)
-
-(* Descriptor for libraries *)
-
-type library =
- { lib_units: compilation_unit list; (* List of compilation units *)
- lib_custom: bool; (* Requires custom mode linking? *)
- lib_ccobjs: string list; (* C object files needed for -custom *)
- lib_ccopts: string list; (* Extra opts to C compiler *)
- lib_dllibs: string list } (* DLLs needed *)
+open Cmo_format
(* Buffering of bytecode *)
diff --git a/bytecomp/emitcode.mli b/bytecomp/emitcode.mli
index 226f869971..fa20de1816 100644
--- a/bytecomp/emitcode.mli
+++ b/bytecomp/emitcode.mli
@@ -14,54 +14,9 @@
(* Generation of bytecode for .cmo files *)
-open Lambda
+open Cmo_format
open Instruct
-(* Relocation information *)
-
-type reloc_info =
- Reloc_literal of structured_constant (* structured constant *)
- | Reloc_getglobal of Ident.t (* reference to a global *)
- | Reloc_setglobal of Ident.t (* definition of a global *)
- | Reloc_primitive of string (* C primitive number *)
-
-(* Descriptor for compilation units *)
-
-type compilation_unit =
- { cu_name: string; (* Name of compilation unit *)
- mutable cu_pos: int; (* Absolute position in file *)
- cu_codesize: int; (* Size of code block *)
- cu_reloc: (reloc_info * int) list; (* Relocation information *)
- cu_imports: (string * Digest.t) list; (* Names and CRC of intfs imported *)
- cu_primitives: string list; (* Primitives declared inside *)
- mutable cu_force_link: bool; (* Must be linked even if unref'ed *)
- mutable cu_debug: int; (* Position of debugging info, or 0 *)
- cu_debugsize: int } (* Length of debugging info *)
-
-(* Format of a .cmo file:
- magic number (Config.cmo_magic_number)
- absolute offset of compilation unit descriptor
- block of relocatable bytecode
- debugging information if any
- compilation unit descriptor *)
-
-(* Descriptor for libraries *)
-
-type library =
- { lib_units: compilation_unit list; (* List of compilation units *)
- lib_custom: bool; (* Requires custom mode linking? *)
- lib_ccobjs: string list; (* C object files needed for -custom *)
- lib_ccopts: string list; (* Extra opts to C compiler *)
- lib_dllibs: string list } (* DLLs needed *)
-
-(* Format of a .cma file:
- magic number (Config.cma_magic_number)
- absolute offset of library descriptor
- object code for first library member
- ...
- object code for last library member
- library descriptor *)
-
val to_file: out_channel -> string -> instruction list -> unit
(* Arguments:
channel on output file
diff --git a/bytecomp/symtable.ml b/bytecomp/symtable.ml
index 6a55cabf28..1538451634 100644
--- a/bytecomp/symtable.ml
+++ b/bytecomp/symtable.ml
@@ -17,7 +17,7 @@
open Misc
open Asttypes
open Lambda
-open Emitcode
+open Cmo_format
(* Functions for batch linking *)
diff --git a/bytecomp/symtable.mli b/bytecomp/symtable.mli
index 8d1bf7cf53..cbef01e25f 100644
--- a/bytecomp/symtable.mli
+++ b/bytecomp/symtable.mli
@@ -14,7 +14,7 @@
(* Assign locations and numbers to globals and primitives *)
-open Emitcode
+open Cmo_format
(* Functions for batch linking *)