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