@@ -42,12 +42,12 @@ exception Not_an_interface
4242
4343exception Make_root_error of string
4444
45- let read_cmt_infos source_id_opt id ~filename () =
45+ let read_cmt_infos source_id_opt id ~filename ~ count_occurrences () =
4646 match Cmt_format. read_cmt filename with
4747 | exception Cmi_format. Error _ -> raise Corrupted
4848 | cmt_info -> (
4949 match cmt_info.cmt_annots with
50- | Implementation _ -> Implementation. read_cmt_infos source_id_opt id cmt_info
50+ | Implementation _ -> Implementation. read_cmt_infos source_id_opt id cmt_info ~count_occurrences
5151 | _ -> raise Not_an_implementation )
5252
5353
@@ -99,7 +99,7 @@ let compilation_unit_of_sig ~make_root ~imports ~interface ?sourcefile ~name ~id
9999 make_compilation_unit ~make_root ~imports ~interface ?sourcefile ~name ~id
100100 ?canonical ?shape_info content
101101
102- let read_cmti ~make_root ~parent ~filename ~cmt_filename_opt ~source_id_opt () =
102+ let read_cmti ~make_root ~parent ~filename ~cmt_filename_opt ~source_id_opt ~ count_occurrences () =
103103 let cmt_info = Cmt_format. read_cmt filename in
104104 match cmt_info.cmt_annots with
105105 | Interface intf -> (
@@ -116,15 +116,16 @@ let read_cmti ~make_root ~parent ~filename ~cmt_filename_opt ~source_id_opt () =
116116 let shape_info, source_info =
117117 match cmt_filename_opt with
118118 | Some cmt_filename ->
119- read_cmt_infos source_id_opt id ~filename: cmt_filename ()
120- | None -> (None , None )
119+ read_cmt_infos source_id_opt id ~filename: cmt_filename ~count_occurrences ()
120+ | None ->
121+ (None , None )
121122 in
122123 compilation_unit_of_sig ~make_root ~imports: cmt_info.cmt_imports
123124 ~interface ~sourcefile ~name ~id ?shape_info ~source_info
124125 ?canonical sg)
125126 | _ -> raise Not_an_interface
126127
127- let read_cmt ~make_root ~parent ~filename ~source_id_opt () =
128+ let read_cmt ~make_root ~parent ~filename ~source_id_opt ~ count_occurrences () =
128129 match Cmt_format. read_cmt filename with
129130 | exception Cmi_format. Error (Not_an_interface _ ) ->
130131 raise Not_an_implementation
@@ -168,7 +169,7 @@ let read_cmt ~make_root ~parent ~filename ~source_id_opt () =
168169 | Implementation impl ->
169170 let id, sg, canonical = Cmt. read_implementation parent name impl in
170171 let shape_info, source_info =
171- read_cmt_infos source_id_opt id ~filename ()
172+ read_cmt_infos source_id_opt id ~filename ~count_occurrences ()
172173 in
173174 compilation_unit_of_sig ~make_root ~imports ~interface ~sourcefile
174175 ~name ~id ?canonical ?shape_info ~source_info sg
@@ -199,12 +200,12 @@ let wrap_errors ~filename f =
199200 | Not_an_interface -> not_an_interface filename
200201 | Make_root_error m -> error_msg filename m)
201202
202- let read_cmti ~make_root ~parent ~filename ~source_id_opt ~cmt_filename_opt =
203+ let read_cmti ~make_root ~parent ~filename ~source_id_opt ~cmt_filename_opt ~ count_occurrences =
203204 wrap_errors ~filename
204- (read_cmti ~make_root ~parent ~filename ~source_id_opt ~cmt_filename_opt )
205+ (read_cmti ~make_root ~parent ~filename ~source_id_opt ~cmt_filename_opt ~count_occurrences )
205206
206- let read_cmt ~make_root ~parent ~filename ~source_id_opt =
207- wrap_errors ~filename (read_cmt ~make_root ~parent ~filename ~source_id_opt )
207+ let read_cmt ~make_root ~parent ~filename ~source_id_opt ~ count_occurrences =
208+ wrap_errors ~filename (read_cmt ~make_root ~parent ~filename ~source_id_opt ~count_occurrences )
208209
209210let read_cmi ~make_root ~parent ~filename =
210211 wrap_errors ~filename (read_cmi ~make_root ~parent ~filename )
0 commit comments