@@ -59,7 +59,10 @@ let declare_symbol_for_function_slot env ident function_slot : Env.t * Symbol.t
59
59
(Compilation_unit. get_current_exn () )
60
60
(Linkage_name. of_string (Function_slot. to_string function_slot))
61
61
in
62
- let env = Env. add_simple_to_substitute env ident (Simple. symbol symbol) K.With_subkind. any_value in
62
+ let env =
63
+ Env. add_simple_to_substitute env ident (Simple. symbol symbol)
64
+ K.With_subkind. any_value
65
+ in
63
66
env, symbol
64
67
65
68
let register_const0 acc constant name =
@@ -726,7 +729,8 @@ let close_named acc env ~let_bound_var (named : IR.named)
726
729
(fun acc named -> k acc (Some named))
727
730
| Prim { prim; args; loc; exn_continuation; region } ->
728
731
close_primitive acc env ~let_bound_var named prim ~args loc exn_continuation
729
- ~current_region: (fst (Env. find_var env region)) k
732
+ ~current_region: (fst (Env. find_var env region))
733
+ k
730
734
731
735
let close_let acc env id user_visible kind defining_expr
732
736
~(body : Acc.t -> Env.t -> Expr_with_acc.t ) : Expr_with_acc.t =
@@ -798,7 +802,8 @@ let close_let acc env id user_visible kind defining_expr
798
802
(* In spirit, this is the same as the simple case but more
799
803
cumbersome to detect, we have to remove the now useless
800
804
let-binding later. *)
801
- Some (Env. add_simple_to_substitute env id (Simple. symbol sym) kind)
805
+ Some
806
+ (Env. add_simple_to_substitute env id (Simple. symbol sym) kind)
802
807
| _ ->
803
808
Some (Env. add_value_approximation body_env (Name. var var) approx))
804
809
)
@@ -830,17 +835,16 @@ let close_let_cont acc env ~name ~is_exn_handler ~params
830
835
Misc. fatal_errorf
831
836
" [Let_cont]s marked as exception handlers must be [Nonrecursive]: %a"
832
837
Continuation. print name);
833
- let params_with_kinds = List. map (fun (param , user_visible , kind ) ->
834
- (param, user_visible, K.With_subkind. from_lambda kind)
835
- ) params
836
- in
837
- let handler_env, params =
838
- Env. add_vars_like env params_with_kinds
838
+ let params_with_kinds =
839
+ List. map
840
+ (fun (param , user_visible , kind ) ->
841
+ param, user_visible, K.With_subkind. from_lambda kind)
842
+ params
839
843
in
844
+ let handler_env, params = Env. add_vars_like env params_with_kinds in
840
845
let handler_params =
841
846
List. map2
842
- (fun param (_ , _ , kind ) ->
843
- BP. create param kind)
847
+ (fun param (_ , _ , kind ) -> BP. create param kind)
844
848
params params_with_kinds
845
849
|> Bound_parameters. create
846
850
in
@@ -1191,7 +1195,10 @@ let close_one_function acc ~code_id ~external_env ~by_function_slot decl
1191
1195
in
1192
1196
let simple = Simple. with_coercion (Simple. var var) coerce_to_deeper in
1193
1197
let approx = Function_slot.Map. find function_slot approx_map in
1194
- let env = Env. add_simple_to_substitute env let_rec_ident simple K.With_subkind. any_value in
1198
+ let env =
1199
+ Env. add_simple_to_substitute env let_rec_ident simple
1200
+ K.With_subkind. any_value
1201
+ in
1195
1202
let env = Env. add_value_approximation env (Name. var var) approx in
1196
1203
to_bind, env)
1197
1204
(Variable.Map. empty, closure_env)
@@ -1201,23 +1208,26 @@ let close_one_function acc ~code_id ~external_env ~by_function_slot decl
1201
1208
Ident.Map. fold
1202
1209
(fun id var env ->
1203
1210
let simple, kind = find_simple_from_id_with_kind external_env id in
1204
- Simple. pattern_match
1205
- simple
1211
+ Simple. pattern_match simple
1206
1212
~const: (fun _ -> assert false )
1207
1213
~name: (fun name ~coercion :_ ->
1208
- Env. add_approximation_alias (Env. add_var env id var kind) name
1209
- (Name. var var)))
1214
+ Env. add_approximation_alias
1215
+ (Env. add_var env id var kind)
1216
+ name (Name. var var)))
1210
1217
value_slots_for_idents closure_env
1211
1218
in
1212
1219
let closure_env =
1213
1220
List. fold_right
1214
1221
(fun (id , kind ) env ->
1215
- let env, _var = Env. add_var_like env id User_visible (K.With_subkind. from_lambda kind) in
1222
+ let env, _var =
1223
+ Env. add_var_like env id User_visible (K.With_subkind. from_lambda kind)
1224
+ in
1216
1225
env)
1217
1226
params closure_env
1218
1227
in
1219
1228
let closure_env, my_region =
1220
- Env. add_var_like closure_env my_region Not_user_visible K.With_subkind. region
1229
+ Env. add_var_like closure_env my_region Not_user_visible
1230
+ K.With_subkind. region
1221
1231
in
1222
1232
let closure_env = Env. with_depth closure_env my_depth in
1223
1233
let closure_env, absolute_history, relative_history =
@@ -1588,13 +1598,13 @@ let close_functions acc external_env ~current_region function_declarations =
1588
1598
let value_slots =
1589
1599
Ident.Map. fold
1590
1600
(fun id value_slot map ->
1591
- let external_simple, kind = find_simple_from_id_with_kind external_env id in
1601
+ let external_simple, kind =
1602
+ find_simple_from_id_with_kind external_env id
1603
+ in
1592
1604
(* We're sure [external_simple] is a variable since
1593
1605
[value_slot_from_idents] has already filtered constants and symbols
1594
1606
out. *)
1595
- Value_slot.Map. add value_slot
1596
- (external_simple, kind)
1597
- map)
1607
+ Value_slot.Map. add value_slot (external_simple, kind) map)
1598
1608
value_slots_from_idents Value_slot.Map. empty
1599
1609
in
1600
1610
let set_of_closures =
@@ -1636,15 +1646,19 @@ let close_let_rec acc env ~function_declarations
1636
1646
List. fold_right
1637
1647
(fun decl env ->
1638
1648
let id = Function_decl. let_rec_ident decl in
1639
- let env, _var = Env. add_var_like env id User_visible K.With_subkind. any_value in
1649
+ let env, _var =
1650
+ Env. add_var_like env id User_visible K.With_subkind. any_value
1651
+ in
1640
1652
env)
1641
1653
function_declarations env
1642
1654
in
1643
1655
let fun_vars_map, ident_map =
1644
1656
List. fold_left
1645
1657
(fun (fun_vars_map , ident_map ) decl ->
1646
1658
let ident = Function_decl. let_rec_ident decl in
1647
- let fun_var = VB. create (fst (Env. find_var env ident)) Name_mode. normal in
1659
+ let fun_var =
1660
+ VB. create (fst (Env. find_var env ident)) Name_mode. normal
1661
+ in
1648
1662
let function_slot = Function_decl. function_slot decl in
1649
1663
( Function_slot.Map. add function_slot fun_var fun_vars_map,
1650
1664
Function_slot.Map. add function_slot ident ident_map ))
@@ -1687,7 +1701,8 @@ let close_let_rec acc env ~function_declarations
1687
1701
(fun function_slot (symbol , approx ) env ->
1688
1702
let ident = Function_slot.Map. find function_slot ident_map in
1689
1703
let env =
1690
- Env. add_simple_to_substitute env ident (Simple. symbol symbol) K.With_subkind. any_value
1704
+ Env. add_simple_to_substitute env ident (Simple. symbol symbol)
1705
+ K.With_subkind. any_value
1691
1706
in
1692
1707
Env. add_value_approximation env (Name. symbol symbol) approx)
1693
1708
symbols env
@@ -2114,7 +2129,8 @@ let close_program (type mode) ~(mode : mode Flambda_features.mode)
2114
2129
let module_block_var = Variable. create " module_block" in
2115
2130
let return_cont = Continuation. create ~sort: Toplevel_return () in
2116
2131
let env, toplevel_my_region =
2117
- Env. add_var_like env toplevel_my_region Not_user_visible Flambda_kind.With_subkind. region
2132
+ Env. add_var_like env toplevel_my_region Not_user_visible
2133
+ Flambda_kind.With_subkind. region
2118
2134
in
2119
2135
let slot_offsets = Slot_offsets. empty in
2120
2136
let acc = Acc. create ~symbol_for_global ~slot_offsets in
0 commit comments