File tree 4 files changed +20
-3
lines changed
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 17
17
18
18
(* * cms and cmsi files format. *)
19
19
20
+ module Uid = Shape. Uid
21
+
20
22
let read_magic_number ic =
21
23
let len_magic_number = String. length Config. cms_magic_number in
22
24
really_input_string ic len_magic_number
@@ -32,7 +34,9 @@ type cms_infos = {
32
34
cms_uid_to_attributes : Parsetree .attributes Shape.Uid.Tbl .t ;
33
35
cms_impl_shape : Shape .t option ; (* None for mli *)
34
36
cms_ident_occurrences :
35
- (Longident .t Location .loc * Shape_reduce .result ) array
37
+ (Longident .t Location .loc * Shape_reduce .result ) array ;
38
+ cms_declaration_dependencies :
39
+ (Cmt_format .dependency_kind * Uid .t * Uid .t ) list ;
36
40
}
37
41
38
42
type error =
@@ -114,6 +118,9 @@ let save_cms target modname binary_annots initial_env shape =
114
118
let cms_uid_to_loc, cms_uid_to_attributes =
115
119
uid_tables_of_binary_annots binary_annots
116
120
in
121
+ let cms_declaration_dependencies =
122
+ Cmt_format. get_declaration_dependencies ()
123
+ in
117
124
let cms =
118
125
{
119
126
cms_modname = modname;
@@ -125,7 +132,8 @@ let save_cms target modname binary_annots initial_env shape =
125
132
cms_uid_to_loc;
126
133
cms_uid_to_attributes;
127
134
cms_impl_shape = shape;
128
- cms_ident_occurrences
135
+ cms_ident_occurrences;
136
+ cms_declaration_dependencies;
129
137
}
130
138
in
131
139
output_cms oc cms)
Original file line number Diff line number Diff line change 17
17
18
18
(* * cms and cmsi files format. *)
19
19
20
+ module Uid = Shape. Uid
21
+
20
22
type cms_infos = {
21
23
cms_modname : Compilation_unit .t ;
22
24
cms_comments : (string * Location .t ) list ;
@@ -28,7 +30,9 @@ type cms_infos = {
28
30
cms_uid_to_attributes : Parsetree .attributes Shape.Uid.Tbl .t ;
29
31
cms_impl_shape : Shape .t option ; (* None for mli *)
30
32
cms_ident_occurrences :
31
- (Longident .t Location .loc * Shape_reduce .result ) array
33
+ (Longident .t Location .loc * Shape_reduce .result ) array ;
34
+ cms_declaration_dependencies :
35
+ (Cmt_format .dependency_kind * Uid .t * Uid .t ) list ;
32
36
}
33
37
34
38
type error =
Original file line number Diff line number Diff line change @@ -518,3 +518,5 @@ let save_cmt target cu binary_annots initial_env cmi shape =
518
518
output_cmt oc cmt)
519
519
end ;
520
520
clear ()
521
+
522
+ let get_declaration_dependencies () = ! uids_deps
Original file line number Diff line number Diff line change @@ -133,3 +133,6 @@ val need_to_clear_env : bool
133
133
val read_signature : 'a -> string -> Types.signature * 'b list * 'c list
134
134
135
135
*)
136
+
137
+ val get_declaration_dependencies :
138
+ unit -> (dependency_kind * Uid .t * Uid .t ) list
You can’t perform that action at this time.
0 commit comments