@@ -61,11 +61,11 @@ and binary_part =
6161 | Partial_signature_item of signature_item
6262 | Partial_module_type of module_type
6363
64+ type dependency_kind = Definition_to_declaration | Declaration_to_declaration
6465type cmt_infos = {
6566 cmt_modname : Compilation_unit .t ;
6667 cmt_annots : binary_annots ;
67- cmt_value_dependencies :
68- (Types .value_description * Types .value_description ) list ;
68+ cmt_declaration_dependencies : (dependency_kind * Uid .t * Uid .t ) list ;
6969 cmt_comments : (string * Location .t ) list ;
7070 cmt_args : string array ;
7171 cmt_sourcefile : string option ;
@@ -467,21 +467,31 @@ let read_cmi filename =
467467 | Some cmi , _ -> cmi
468468
469469let saved_types = ref []
470- let value_deps = ref []
470+ let uids_deps : (dependency_kind * Uid.t * Uid.t) list ref = ref []
471471
472472let clear () =
473473 saved_types := [] ;
474- value_deps := []
474+ uids_deps := []
475475
476476let add_saved_type b = saved_types := b :: ! saved_types
477477let get_saved_types () = ! saved_types
478478let set_saved_types l = saved_types := l
479479
480+ <<<<<<< janestreet/ merlin- jst:merge- compiler- renaming- changes
480481(* let record_value_dependency vd1 vd2 =
481482 if vd1.Types.val_loc <> vd2.Types.val_loc then
482483 value_deps := (vd1, vd2) :: !value_deps*)
483484
484485let record_value_dependency _vd1 _vd2 = ()
486+ ||||||| ocaml- flambda/ flambda- backend:60158e06115 c6fc6e30325bb720e65acf351dbce
487+ let record_value_dependency vd1 vd2 =
488+ if vd1.Types. val_loc <> vd2.Types. val_loc then
489+ value_deps := (vd1, vd2) :: ! value_deps
490+ =======
491+ let record_declaration_dependency (rk , uid1 , uid2 ) =
492+ if not (Uid. equal uid1 uid2) then
493+ uids_deps := (rk, uid1, uid2) :: ! uids_deps
494+ >>>>>>> ocaml- flambda/ flambda- backend:87 a4cecacc0e2f9afee93898f81f55b012c69214
485495
486496let save_cmt target cu binary_annots initial_env cmi shape =
487497 if ! Clflags. binary_annotations && not ! Clflags. print_types then begin
@@ -516,8 +526,16 @@ let save_cmt target cu binary_annots initial_env cmi shape =
516526 let cmt = {
517527 cmt_modname = cu;
518528 cmt_annots;
529+ <<<<<<< janestreet/ merlin- jst :merge- compiler- renaming- changes
519530 cmt_value_dependencies = ! value_deps;
520531 cmt_comments = [] ;
532+ ||||||| ocaml- flambda/ flambda- backend :60158e06115 c6fc6e30325bb720e65acf351dbce
533+ cmt_value_dependencies = ! value_deps;
534+ cmt_comments = Lexer. comments () ;
535+ =======
536+ cmt_declaration_dependencies = ! uids_deps;
537+ cmt_comments = Lexer. comments () ;
538+ >>>>>>> ocaml- flambda/ flambda- backend :87 a4cecacc0e2f9afee93898f81f55b012c69214
521539 cmt_args = Sys .argv ;
522540 cmt_sourcefile = sourcefile;
523541 cmt_builddir = Location. rewrite_absolute_path (Sys. getcwd () );
@@ -535,3 +553,5 @@ let save_cmt target cu binary_annots initial_env cmi shape =
535553 output_cmt oc cmt)
536554 end ;
537555 clear ()
556+
557+ let get_declaration_dependencies () = ! uids_deps
0 commit comments