Skip to content

Commit 7d16b55

Browse files
committed
Resolve merge conflicts
1 parent 5580042 commit 7d16b55

File tree

8 files changed

+23
-192
lines changed

8 files changed

+23
-192
lines changed

src/ocaml/typing/cms_format.ml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -121,41 +121,22 @@ let save_cms target modname binary_annots initial_env shape
121121
in
122122
let cms = {
123123
cms_modname = modname;
124-
cms_comments = [];
125124
(* XXX merlin: upstream does
126-
cms_sourcefile = sourcefile;
127-
cms_builddir = Location.rewrite_absolute_path (Sys.getcwd ());
128-
cms_source_digest = source_digest;
129-
cms_initial_env;
130-
cms_uid_to_loc;
131-
cms_uid_to_attributes;
132-
cms_impl_shape = shape;
133-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
134-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
135-
cms_ident_occurrences
136-
}
137-
in
138-
output_cms oc cms)
139-
=======
140-
cms_ident_occurrences;
141-
cms_declaration_dependencies;
142-
}
143-
in
144-
output_cms oc cms)
145-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
146-
`cms_comments = Lexer.comments ()`
125+
`cms_comments = Lexer.comments ()`
147126
here. But we don't seem to have the same lexer, so we can't
148127
do that straightforwardly. On the other hand, this function
149128
should never be called by merlin, so it doesn't matter, right?
150129
*)
130+
cms_comments = [];
151131
cms_sourcefile = sourcefile;
152132
cms_builddir = Location.rewrite_absolute_path (Sys.getcwd ());
153133
cms_source_digest = source_digest;
154134
cms_initial_env;
155135
cms_uid_to_loc;
156136
cms_uid_to_attributes;
157137
cms_impl_shape = shape;
158-
cms_ident_occurrences
138+
cms_ident_occurrences;
139+
cms_declaration_dependencies;
159140
} in
160141
output_cms oc cms)
161142
end

src/ocaml/typing/cmt_format.ml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -477,21 +477,7 @@ let add_saved_type b = saved_types := b :: !saved_types
477477
let get_saved_types () = !saved_types
478478
let set_saved_types l = saved_types := l
479479

480-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
481-
(*let record_value_dependency vd1 vd2 =
482-
if vd1.Types.val_loc <> vd2.Types.val_loc then
483-
value_deps := (vd1, vd2) :: !value_deps*)
484-
485-
let record_value_dependency _vd1 _vd2 = ()
486-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
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:87a4cecacc0e2f9afee93898f81f55b012c69214
480+
let record_declaration_dependency (_rk, _uid1, _uid2) = ()
495481

496482
let save_cmt target cu binary_annots initial_env cmi shape =
497483
if !Clflags.binary_annotations && not !Clflags.print_types then begin
@@ -526,16 +512,8 @@ let save_cmt target cu binary_annots initial_env cmi shape =
526512
let cmt = {
527513
cmt_modname = cu;
528514
cmt_annots;
529-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
530-
cmt_value_dependencies = !value_deps;
531-
cmt_comments = [];
532-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
533-
cmt_value_dependencies = !value_deps;
534-
cmt_comments = Lexer.comments ();
535-
=======
536515
cmt_declaration_dependencies = !uids_deps;
537-
cmt_comments = Lexer.comments ();
538-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
516+
cmt_comments = [];
539517
cmt_args = Sys.argv;
540518
cmt_sourcefile = sourcefile;
541519
cmt_builddir = Location.rewrite_absolute_path (Sys.getcwd ());

src/ocaml/typing/cmt_format.mli

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ val need_to_clear_env : bool
134134
135135
*)
136136

137+
val get_declaration_dependencies :
138+
unit -> (dependency_kind * Uid.t * Uid.t) list
139+
137140
val iter_on_declarations :
138141
f:(Types.Uid.t -> item_declaration -> unit)
139142
-> Tast_iterator.iterator
@@ -142,19 +145,6 @@ val iter_on_occurrences :
142145
f:(namespace:Shape.Sig_component_kind.t ->
143146
Env.t ->
144147
Path.t ->
145-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
146148
Longident.t Location.loc ->
147149
unit)
148150
-> Tast_iterator.iterator
149-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
150-
val read_signature : 'a -> string -> Types.signature * 'b list * 'c list
151-
152-
*)
153-
=======
154-
val read_signature : 'a -> string -> Types.signature * 'b list * 'c list
155-
156-
*)
157-
158-
val get_declaration_dependencies :
159-
unit -> (dependency_kind * Uid.t * Uid.t) list
160-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214

src/ocaml/typing/lambda.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type boxed_integer = Primitive.boxed_integer =
1616

1717
type boxed_vector = Primitive.boxed_vector =
1818
| Boxed_vec128
19+
| Boxed_vec256
20+
| Boxed_vec512
1921

2022
type unboxed_float = Primitive.unboxed_float =
2123
| Unboxed_float64
@@ -28,6 +30,8 @@ type unboxed_integer = Primitive.unboxed_integer =
2830

2931
type unboxed_vector = Primitive.unboxed_vector =
3032
| Unboxed_vec128
33+
| Unboxed_vec256
34+
| Unboxed_vec512
3135

3236
type array_kind =
3337
Pgenarray | Paddrarray | Pintarray | Pfloatarray

src/ocaml/typing/printtyp.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -770,16 +770,8 @@ let wrap_printing_env_error env f =
770770
let wrap (loc : _ Location.loc) =
771771
{ loc with txt =
772772
(fun fmt -> Env.without_cmis (fun () -> loc.txt fmt) ())
773-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
774-
(* CR nroberts: See https://github.com/ocaml-flambda/flambda-backend/pull/2529
775-
for an explanation of why this has drifted from upstream. *)
776-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
777-
(* CR nroberts: See https://github.com/ocaml-flambda/flambda-backend/pull/2529
778-
for an explanation of why this has drifted from upstream. *)
779-
=======
780773
(* CR nroberts: See https://github.com/oxcaml/oxcaml/pull/2529
781774
for an explanation of why this has drifted from upstream. *)
782-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
783775
}
784776
in
785777
let err : Location.error = wrap_printing_env ~error:true env f in

src/ocaml/typing/typemod.ml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,15 +3895,7 @@ let type_implementation target modulename initial_env ast =
38953895
Cmt_format.save_cmt (Unit_info.cmt target) modulename
38963896
annots initial_env cmi shape;
38973897
Cms_format.save_cms (Unit_info.cms target) modulename
3898-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
3899-
annots initial_env shape;
3900-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
3901-
annots initial_env shape;
3902-
gen_annot target annots;
3903-
=======
39043898
annots initial_env shape decl_deps;
3905-
gen_annot target annots;
3906-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
39073899
in
39083900
Cmt_format.clear ();
39093901
Cms_format.clear ();
@@ -3988,18 +3980,8 @@ let type_implementation target modulename initial_env ast =
39883980
{ new_arg_type = arg_type; old_source_file = source_intf;
39893981
old_arg_type = arg_type_from_cmi });
39903982
let coercion, shape =
3991-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
3992-
Includemod.compunit initial_env ~mark:Mark_positive
3993-
sourcefile sg compiled_intf_file_name dclsig shape
3994-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
3995-
Profile.record_call "check_sig" (fun () ->
3996-
Includemod.compunit initial_env ~mark:Mark_positive
3997-
sourcefile sg compiled_intf_file_name dclsig shape)
3998-
=======
3999-
Profile.record_call "check_sig" (fun () ->
40003983
Includemod.compunit initial_env ~mark:true
4001-
sourcefile sg compiled_intf_file_name dclsig shape)
4002-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
3984+
sourcefile sg compiled_intf_file_name dclsig shape
40033985
in
40043986
(* Check the _mli_ against the argument type, since the mli determines
40053987
the visible type of the module and that's what needs to conform to
@@ -4032,18 +4014,8 @@ let type_implementation target modulename initial_env ast =
40324014
(Location.in_file (Unit_info.source_file target))
40334015
Warnings.Missing_mli;
40344016
let coercion, shape =
4035-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
4036-
Includemod.compunit initial_env ~mark:Mark_positive
4037-
sourcefile sg "(inferred signature)" simple_sg shape
4038-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
4039-
Profile.record_call "check_sig" (fun () ->
4040-
Includemod.compunit initial_env ~mark:Mark_positive
4041-
sourcefile sg "(inferred signature)" simple_sg shape)
4042-
=======
4043-
Profile.record_call "check_sig" (fun () ->
40444017
Includemod.compunit initial_env ~mark:true
4045-
sourcefile sg "(inferred signature)" simple_sg shape)
4046-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
4018+
sourcefile sg "(inferred signature)" simple_sg shape
40474019
in
40484020
check_nongen_signature finalenv simple_sg;
40494021
let simple_sg =

src/ocaml/typing/typeopt.ml

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,7 @@ open Types
2020
open Typedtree
2121
open Lambda
2222

23-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
2423
(* Expand a type, looking through ordinary synonyms, private synonyms, links,
25-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
26-
type error =
27-
Non_value_layout of type_expr * Jkind.Violation.t option
28-
| Non_value_sort of Jkind.Sort.t * type_expr
29-
| Sort_without_extension of
30-
Jkind.Sort.t * Language_extension.maturity * type_expr option
31-
| Non_value_sort_unknown_ty of Jkind.Sort.t
32-
| Small_number_sort_without_extension of Jkind.Sort.t * type_expr option
33-
| Simd_sort_without_extension of Jkind.Sort.t * type_expr option
34-
| Not_a_sort of type_expr * Jkind.Violation.t
35-
=======
36-
type error =
37-
Non_value_layout of type_expr * Jkind.Violation.t option
38-
| Sort_without_extension of
39-
Jkind.Sort.t * Language_extension.maturity * type_expr option
40-
| Small_number_sort_without_extension of Jkind.Sort.t * type_expr option
41-
| Simd_sort_without_extension of Jkind.Sort.t * type_expr option
42-
| Not_a_sort of type_expr * Jkind.Violation.t
43-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
4424
and [@@unboxed] types. The returned type will be therefore be none of these
4525
cases (except in case of missing cmis).
4626
@@ -231,26 +211,7 @@ let array_kind_of_elt ~elt_sort env loc ty =
231211
| Some s -> s
232212
| None ->
233213
Jkind.Sort.default_for_transl_and_get
234-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
235214
(type_legacy_sort ~why:Array_element env loc ty)
236-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
237-
kinds. *)
238-
match s with
239-
| Base Value -> Paddr_scannable
240-
| Base (Float64 | Float32 | Bits32 | Bits64 | Word | Vec128) as c ->
241-
raise (Error (loc, Mixed_product_array (c, elt_ty_for_error)))
242-
| Base Void as c ->
243-
raise (Error (loc, Unsupported_sort c))
244-
=======
245-
kinds. *)
246-
match s with
247-
| Base Value -> Paddr_scannable
248-
| Base (Float64 | Float32 | Bits32 | Bits64 | Word |
249-
Vec128 | Vec256 | Vec512) as c ->
250-
raise (Error (loc, Mixed_product_array (c, elt_ty_for_error)))
251-
| Base Void as c ->
252-
raise (Error (loc, Unsupported_sort c))
253-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
254215
in
255216
let classify_product ty _sorts =
256217
if is_always_gc_ignorable env ty then
@@ -266,24 +227,7 @@ let array_kind_of_elt ~elt_sort env loc ty =
266227
| Unboxed_float f -> Punboxedfloatarray f
267228
| Unboxed_int i -> Punboxedintarray i
268229
| Unboxed_vector v -> Punboxedvectorarray v
269-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
270230
| Product c -> c
271-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
272-
| Base Bits32 -> Punboxedint_ignorable Unboxed_int32
273-
| Base Bits64 -> Punboxedint_ignorable Unboxed_int64
274-
| Base Word -> Punboxedint_ignorable Unboxed_nativeint
275-
| Base Vec128 -> raise (Error (loc, Unsupported_vector_in_product_array))
276-
| Base Void as c -> raise (Error (loc, Unsupported_sort c))
277-
| Product sorts -> Pproduct_ignorable (ignorable_product_array_kind loc sorts)
278-
=======
279-
| Base Bits32 -> Punboxedint_ignorable Unboxed_int32
280-
| Base Bits64 -> Punboxedint_ignorable Unboxed_int64
281-
| Base Word -> Punboxedint_ignorable Unboxed_nativeint
282-
| Base (Vec128 | Vec256 | Vec512) ->
283-
raise (Error (loc, Unsupported_vector_in_product_array))
284-
| Base Void as c -> raise (Error (loc, Unsupported_sort c))
285-
| Product sorts -> Pproduct_ignorable (ignorable_product_array_kind loc sorts)
286-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
287231

288232
let array_type_kind ~elt_sort env loc ty =
289233
match scrape_poly env ty with
@@ -1106,29 +1050,3 @@ let rec layout_union l1 l2 =
11061050
_ ->
11071051
Ptop
11081052
*)
1109-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
1110-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
1111-
(Jkind.Violation.report_with_offender
1112-
~offender:(fun ppf -> Printtyp.type_expr ppf ty)) err
1113-
end
1114-
| Non_value_sort (sort, ty) ->
1115-
fprintf ppf
1116-
"Non-value layout %a detected in [Typeopt.layout] as sort for type@ %a.@ \
1117-
Please report this error to the Jane Street compilers team."
1118-
Jkind.Sort.format sort Printtyp.type_expr ty
1119-
| Non_value_sort_unknown_ty sort ->
1120-
fprintf ppf
1121-
"Non-value layout %a detected in [layout_of_sort]@ Please report this \
1122-
error to the Jane Street compilers team."
1123-
Jkind.Sort.format sort
1124-
| Sort_without_extension (sort, maturity, ty) ->
1125-
fprintf ppf "Non-value layout %a detected" Jkind.Sort.format sort;
1126-
begin match ty with
1127-
=======
1128-
(Jkind.Violation.report_with_offender
1129-
~offender:(fun ppf -> Printtyp.type_expr ppf ty)) err
1130-
end
1131-
| Sort_without_extension (sort, maturity, ty) ->
1132-
fprintf ppf "Non-value layout %a detected" Jkind.Sort.format sort;
1133-
begin match ty with
1134-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214

src/ocaml/typing/types.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
(* *)
1414
(**************************************************************************)
1515

16+
(* Merlin-only: rewrite some module paths to minimize the diff *)
17+
module Misc = struct
18+
include Misc
19+
module Stdlib = Misc_stdlib
20+
end
21+
1622
(* Representation of types and declarations *)
1723

1824
open Allowance
@@ -988,19 +994,9 @@ let rec equal_mixed_block_element e1 e2 =
988994
| Vec128, Vec128 | Vec256, Vec256 | Vec512, Vec512
989995
-> true
990996
| Product es1, Product es2
991-
<<<<<<< janestreet/merlin-jst:merge-compiler-renaming-changes
992-
-> Misc_stdlib.Array.equal equal_mixed_block_element es1 es2
993-
| ( Value | Float64 | Float32 | Float_boxed | Word | Bits32 | Bits64 | Vec128
994-
| Product _ ), _
995-
||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
996-
-> Misc.Stdlib.Array.equal equal_mixed_block_element es1 es2
997-
| ( Value | Float64 | Float32 | Float_boxed | Word | Bits32 | Bits64 | Vec128
998-
| Product _ ), _
999-
=======
1000997
-> Misc.Stdlib.Array.equal equal_mixed_block_element es1 es2
1001998
| ( Value | Float64 | Float32 | Float_boxed | Word | Bits32 | Bits64
1002999
| Vec128 | Vec256 | Vec512 | Product _ ), _
1003-
>>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
10041000
-> false
10051001

10061002
let rec compare_mixed_block_element e1 e2 =
@@ -1011,7 +1007,7 @@ let rec compare_mixed_block_element e1 e2 =
10111007
| Vec128, Vec128 | Vec256, Vec256 | Vec512, Vec512
10121008
-> 0
10131009
| Product es1, Product es2
1014-
-> Misc_stdlib.Array.compare compare_mixed_block_element es1 es2
1010+
-> Misc.Stdlib.Array.compare compare_mixed_block_element es1 es2
10151011
| Value, _ -> -1
10161012
| _, Value -> 1
10171013
| Float_boxed, _ -> -1
@@ -1496,7 +1492,7 @@ let equal_unsafe_mode_crossing
14961492
~type_equal
14971493
{ unsafe_mod_bounds = mc1; unsafe_with_bounds = wb2 }
14981494
umc2 =
1499-
Misc_stdlib.Le_result.equal ~le:Mode.Crossing.le mc1 umc2.unsafe_mod_bounds
1495+
Misc.Stdlib.Le_result.equal ~le:Mode.Crossing.le mc1 umc2.unsafe_mod_bounds
15001496
&& (match wb2, umc2.unsafe_with_bounds with
15011497
| No_with_bounds, No_with_bounds -> true
15021498
| No_with_bounds, With_bounds _ | With_bounds _, No_with_bounds -> false

0 commit comments

Comments
 (0)