Skip to content

Commit 686d6e3

Browse files
mshinwellpoechsel
authored andcommitted
flambda-backend: To upstream: fix dependency problem with Instruct
1 parent c311155 commit 686d6e3

File tree

8 files changed

+117
-57
lines changed

8 files changed

+117
-57
lines changed

.depend

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,12 @@ bytecomp/bytesections.cmx : \
18751875
utils/config.cmx \
18761876
bytecomp/bytesections.cmi
18771877
bytecomp/bytesections.cmi :
1878+
bytecomp/debug_event.cmi : \
1879+
typing/types.cmi \
1880+
typing/subst.cmi \
1881+
parsing/location.cmi \
1882+
typing/ident.cmi \
1883+
typing/env.cmi
18781884
bytecomp/dll.cmo : \
18791885
utils/misc.cmi \
18801886
utils/config.cmi \
@@ -1932,6 +1938,7 @@ bytecomp/instruct.cmo : \
19321938
lambda/lambda.cmi \
19331939
typing/ident.cmi \
19341940
typing/env.cmi \
1941+
bytecomp/debug_event.cmi \
19351942
bytecomp/instruct.cmi
19361943
bytecomp/instruct.cmx : \
19371944
typing/types.cmx \
@@ -1940,22 +1947,24 @@ bytecomp/instruct.cmx : \
19401947
lambda/lambda.cmx \
19411948
typing/ident.cmx \
19421949
typing/env.cmx \
1950+
bytecomp/debug_event.cmi \
19431951
bytecomp/instruct.cmi
19441952
bytecomp/instruct.cmi : \
19451953
typing/types.cmi \
19461954
typing/subst.cmi \
19471955
parsing/location.cmi \
19481956
lambda/lambda.cmi \
19491957
typing/ident.cmi \
1950-
typing/env.cmi
1958+
typing/env.cmi \
1959+
bytecomp/debug_event.cmi
19511960
bytecomp/meta.cmo : \
1952-
bytecomp/instruct.cmi \
1961+
bytecomp/debug_event.cmi \
19531962
bytecomp/meta.cmi
19541963
bytecomp/meta.cmx : \
1955-
bytecomp/instruct.cmx \
1964+
bytecomp/debug_event.cmi \
19561965
bytecomp/meta.cmi
19571966
bytecomp/meta.cmi : \
1958-
bytecomp/instruct.cmi
1967+
bytecomp/debug_event.cmi
19591968
bytecomp/opcodes.cmo : \
19601969
bytecomp/opcodes.cmi
19611970
bytecomp/opcodes.cmx : \

bytecomp/debug_event.mli

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
(* Structure of compilation environments *)
17+
18+
type compilation_env =
19+
{ ce_stack: int Ident.tbl; (* Positions of variables in the stack *)
20+
ce_heap: int Ident.tbl; (* Structure of the heap-allocated env *)
21+
ce_rec: int Ident.tbl } (* Functions bound by the same let rec *)
22+
23+
(* The ce_stack component gives locations of variables residing
24+
in the stack. The locations are offsets w.r.t. the origin of the
25+
stack frame.
26+
The ce_heap component gives the positions of variables residing in the
27+
heap-allocated environment.
28+
The ce_rec component associates offsets to identifiers for functions
29+
bound by the same let rec as the current function. The offsets
30+
are used by the OFFSETCLOSURE instruction to recover the closure
31+
pointer of the desired function from the env register (which
32+
points to the closure for the current function). *)
33+
34+
(* Debugging events *)
35+
36+
(* Warning: when you change these types, check runtime/backtrace_byt.c *)
37+
type debug_event =
38+
{ mutable ev_pos: int; (* Position in bytecode *)
39+
ev_module: string; (* Name of defining module *)
40+
ev_loc: Location.t; (* Location in source file *)
41+
ev_kind: debug_event_kind; (* Before/after event *)
42+
ev_defname: string; (* Enclosing definition *)
43+
ev_info: debug_event_info; (* Extra information *)
44+
ev_typenv: Env.summary; (* Typing environment *)
45+
ev_typsubst: Subst.t; (* Substitution over types *)
46+
ev_compenv: compilation_env; (* Compilation environment *)
47+
ev_stacksize: int; (* Size of stack frame *)
48+
ev_repr: debug_event_repr } (* Position of the representative *)
49+
50+
and debug_event_kind =
51+
Event_before
52+
| Event_after of Types.type_expr
53+
| Event_pseudo
54+
55+
and debug_event_info =
56+
Event_function
57+
| Event_return of int
58+
| Event_other
59+
60+
and debug_event_repr =
61+
Event_none
62+
| Event_parent of int ref
63+
| Event_child of int ref

bytecomp/instruct.ml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@
1515

1616
open Lambda
1717

18-
type compilation_env =
18+
type compilation_env = Debug_event.compilation_env =
1919
{ ce_stack: int Ident.tbl;
2020
ce_heap: int Ident.tbl;
2121
ce_rec: int Ident.tbl }
2222

23-
type debug_event =
24-
{ mutable ev_pos: int; (* Position in bytecode *)
25-
ev_module: string; (* Name of defining module *)
26-
ev_loc: Location.t; (* Location in source file *)
27-
ev_kind: debug_event_kind; (* Before/after event *)
28-
ev_defname: string; (* Enclosing definition *)
29-
ev_info: debug_event_info; (* Extra information *)
30-
ev_typenv: Env.summary; (* Typing environment *)
31-
ev_typsubst: Subst.t; (* Substitution over types *)
32-
ev_compenv: compilation_env; (* Compilation environment *)
33-
ev_stacksize: int; (* Size of stack frame *)
34-
ev_repr: debug_event_repr } (* Position of the representative *)
23+
type debug_event = Debug_event.debug_event =
24+
{ mutable ev_pos: int;
25+
ev_module: string;
26+
ev_loc: Location.t;
27+
ev_kind: debug_event_kind;
28+
ev_defname: string;
29+
ev_info: debug_event_info;
30+
ev_typenv: Env.summary;
31+
ev_typsubst: Subst.t;
32+
ev_compenv: compilation_env;
33+
ev_stacksize: int;
34+
ev_repr: debug_event_repr }
3535

36-
and debug_event_kind =
36+
and debug_event_kind = Debug_event.debug_event_kind =
3737
Event_before
3838
| Event_after of Types.type_expr
3939
| Event_pseudo
4040

41-
and debug_event_info =
41+
and debug_event_info = Debug_event.debug_event_info =
4242
Event_function
4343
| Event_return of int
4444
| Event_other
4545

46-
and debug_event_repr =
46+
and debug_event_repr = Debug_event.debug_event_repr =
4747
Event_none
4848
| Event_parent of int ref
4949
| Event_child of int ref

bytecomp/instruct.mli

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,37 @@ open Lambda
1919

2020
(* Structure of compilation environments *)
2121

22-
type compilation_env =
23-
{ ce_stack: int Ident.tbl; (* Positions of variables in the stack *)
24-
ce_heap: int Ident.tbl; (* Structure of the heap-allocated env *)
25-
ce_rec: int Ident.tbl } (* Functions bound by the same let rec *)
26-
27-
(* The ce_stack component gives locations of variables residing
28-
in the stack. The locations are offsets w.r.t. the origin of the
29-
stack frame.
30-
The ce_heap component gives the positions of variables residing in the
31-
heap-allocated environment.
32-
The ce_rec component associates offsets to identifiers for functions
33-
bound by the same let rec as the current function. The offsets
34-
are used by the OFFSETCLOSURE instruction to recover the closure
35-
pointer of the desired function from the env register (which
36-
points to the closure for the current function). *)
22+
type compilation_env = Debug_event.compilation_env =
23+
{ ce_stack: int Ident.tbl;
24+
ce_heap: int Ident.tbl;
25+
ce_rec: int Ident.tbl }
3726

3827
(* Debugging events *)
3928

40-
(* Warning: when you change these types, check runtime/backtrace_byt.c *)
41-
type debug_event =
42-
{ mutable ev_pos: int; (* Position in bytecode *)
43-
ev_module: string; (* Name of defining module *)
44-
ev_loc: Location.t; (* Location in source file *)
45-
ev_kind: debug_event_kind; (* Before/after event *)
46-
ev_defname: string; (* Enclosing definition *)
47-
ev_info: debug_event_info; (* Extra information *)
48-
ev_typenv: Env.summary; (* Typing environment *)
49-
ev_typsubst: Subst.t; (* Substitution over types *)
50-
ev_compenv: compilation_env; (* Compilation environment *)
51-
ev_stacksize: int; (* Size of stack frame *)
52-
ev_repr: debug_event_repr } (* Position of the representative *)
29+
type debug_event = Debug_event.debug_event =
30+
{ mutable ev_pos: int;
31+
ev_module: string;
32+
ev_loc: Location.t;
33+
ev_kind: debug_event_kind;
34+
ev_defname: string;
35+
ev_info: debug_event_info;
36+
ev_typenv: Env.summary;
37+
ev_typsubst: Subst.t;
38+
ev_compenv: compilation_env;
39+
ev_stacksize: int;
40+
ev_repr: debug_event_repr }
5341

54-
and debug_event_kind =
42+
and debug_event_kind = Debug_event.debug_event_kind =
5543
Event_before
5644
| Event_after of Types.type_expr
5745
| Event_pseudo
5846

59-
and debug_event_info =
47+
and debug_event_info = Debug_event.debug_event_info =
6048
Event_function
6149
| Event_return of int
6250
| Event_other
6351

64-
and debug_event_repr =
52+
and debug_event_repr = Debug_event.debug_event_repr =
6553
Event_none
6654
| Event_parent of int ref
6755
| Event_child of int ref

bytecomp/meta.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ external realloc_global_data : int -> unit = "caml_realloc_global"
1818
type closure = unit -> Obj.t
1919
type bytecode
2020
external reify_bytecode :
21-
bytes array -> Instruct.debug_event list array -> string option ->
21+
bytes array -> Debug_event.debug_event list array -> string option ->
2222
bytecode * closure
2323
= "caml_reify_bytecode"
2424
external release_bytecode : bytecode -> unit

bytecomp/meta.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ external realloc_global_data : int -> unit = "caml_realloc_global"
2020
type closure = unit -> Obj.t
2121
type bytecode
2222
external reify_bytecode :
23-
bytes array -> Instruct.debug_event list array -> string option ->
23+
bytes array -> Debug_event.debug_event list array -> string option ->
2424
bytecode * closure
2525
= "caml_reify_bytecode"
2626
external release_bytecode : bytecode -> unit

dune

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@
7171
translattribute translclass translcore translmod translobj translprim
7272

7373
;; bytecomp/
74-
meta opcodes bytesections dll symtable
74+
debug_event meta opcodes bytesections dll symtable
7575

7676
;; some of COMP
7777
pparse main_args compenv compmisc makedepend compile_common
7878
; manual update: mli only files
7979
cmo_format
80-
; manual update: this is required.
81-
instruct
8280
))
8381

8482
(library
@@ -89,6 +87,7 @@
8987
(modules
9088
;; bytecomp/
9189
bytegen bytelibrarian bytelink bytepackager emitcode printinstr
90+
instruct
9291

9392
;; driver/
9493
errors compile

otherlibs/dynlink/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ COMPILERLIBS_INTFS=\
6969
parsing/parsetree.mli \
7070
typing/outcometree.mli \
7171
file_formats/cmo_format.mli \
72-
file_formats/cmxs_format.mli
72+
file_formats/cmxs_format.mli \
73+
bytecomp/debug_event.mli
7374

7475
# .ml files from compilerlibs that have corresponding .mli files.
7576
COMPILERLIBS_SOURCES=\

0 commit comments

Comments
 (0)