Skip to content

Commit a3bc996

Browse files
committed
make it compile without clambda changes
1 parent 4cd4615 commit a3bc996

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

backend/cmm_helpers.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,12 +3555,12 @@ let emit_constant_closure ((_, global_symb) as symb) fundecls clos_vars cont =
35553555
| arity ->
35563556
(Cint (infix_header pos) :: closure_symbol f2)
35573557
@ Csymbol_address
3558-
(curry_function_sym arity.function_kind
3559-
(List.map machtype_of_layout arity.params_layout)
3560-
(machtype_of_layout arity.return_layout))
3558+
(curry_function_sym (fst arity)
3559+
(List.init (snd arity) (fun _ -> typ_val))
3560+
typ_val)
35613561
:: Cint
35623562
(closure_info
3563-
~arity:(arity.function_kind, List.length arity.params_layout)
3563+
~arity
35643564
~startenv:(startenv - pos) ~is_last)
35653565
:: Csymbol_address f2.label
35663566
:: emit_others (pos + 4) rem)
@@ -3577,12 +3577,12 @@ let emit_constant_closure ((_, global_symb) as symb) fundecls clos_vars cont =
35773577
:: emit_others 3 remainder
35783578
| arity ->
35793579
Csymbol_address
3580-
(curry_function_sym arity.function_kind
3581-
(List.map machtype_of_layout arity.params_layout)
3582-
(machtype_of_layout arity.return_layout))
3580+
(curry_function_sym (fst arity)
3581+
(List.init (snd arity) (fun _ -> typ_val))
3582+
typ_val)
35833583
:: Cint
35843584
(closure_info
3585-
~arity:(arity.function_kind, List.length arity.params_layout)
3585+
~arity
35863586
~startenv ~is_last)
35873587
:: Csymbol_address f1.label :: emit_others 4 remainder)
35883588

backend/cmmgen.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ let rec transl env e =
465465
~startenv:(startenv - pos) ~is_last dbg ::
466466
transl_fundecls (pos + 3) rem
467467
| arity ->
468-
Cconst_symbol (curry_function_sym arity.function_kind (List.map machtype_of_layout arity.params_layout) (machtype_of_layout arity.return_layout), dbg) ::
469-
alloc_closure_info ~arity:(arity.function_kind, List.length arity.params_layout)
468+
Cconst_symbol (curry_function_sym (fst arity) (List.init (snd arity) (fun _ -> typ_val)) typ_val, dbg) ::
469+
alloc_closure_info ~arity
470470
~startenv:(startenv - pos) ~is_last dbg ::
471471
Cconst_symbol (f.label, dbg) ::
472472
transl_fundecls (pos + 4) rem

middle_end/flambda2/to_cmm/to_cmm_set_of_closures.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ let get_func_decl_params_arity t code_id =
5050
Lambda.Curried { nlocal = Code_metadata.num_trailing_local_params info }
5151
in
5252
let closure_code_pointers =
53-
match kind, num_params with
54-
| Curried _, (0 | 1) -> Full_application_only
53+
match kind, params_ty with
54+
| Curried _, ([] | [_]) -> Full_application_only
5555
| (Curried _ | Tupled), _ -> Full_and_partial_application
5656
in
5757
let arity = kind, params_ty, result_ty in
@@ -157,7 +157,7 @@ end = struct
157157
get_func_decl_params_arity env code_id
158158
in
159159
let closure_info =
160-
C.closure_info ~arity ~startenv:(startenv - slot_offset)
160+
C.closure_info ~arity:(kind, List.length params_ty) ~startenv:(startenv - slot_offset)
161161
~is_last:last_function_slot
162162
in
163163
let acc =

0 commit comments

Comments
 (0)