Skip to content

Commit 50c4982

Browse files
authored
Static_const_with_free_names -> Rebuilt_static_const (ocaml#351)
1 parent d7cadb2 commit 50c4982

15 files changed

+91
-91
lines changed

.depend

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5307,7 +5307,7 @@ middle_end/flambda/lifting/lifted_constant.cmo : \
53075307
lambda/tag.cmi \
53085308
middle_end/flambda/terms/symbol_projection.cmi \
53095309
middle_end/flambda/compilenv_deps/symbol.cmi \
5310-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
5310+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
53115311
middle_end/flambda/basic/simple.cmi \
53125312
middle_end/flambda/terms/set_of_closures.cmi \
53135313
middle_end/flambda/naming/name_occurrences.cmi \
@@ -5330,7 +5330,7 @@ middle_end/flambda/lifting/lifted_constant.cmx : \
53305330
lambda/tag.cmx \
53315331
middle_end/flambda/terms/symbol_projection.cmx \
53325332
middle_end/flambda/compilenv_deps/symbol.cmx \
5333-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
5333+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
53345334
middle_end/flambda/basic/simple.cmx \
53355335
middle_end/flambda/terms/set_of_closures.cmx \
53365336
middle_end/flambda/naming/name_occurrences.cmx \
@@ -5349,7 +5349,7 @@ middle_end/flambda/lifting/lifted_constant.cmi : \
53495349
middle_end/flambda/compilenv_deps/variable.cmi \
53505350
middle_end/flambda/terms/symbol_projection.cmi \
53515351
middle_end/flambda/compilenv_deps/symbol.cmi \
5352-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
5352+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
53535353
middle_end/flambda/basic/simple.cmi \
53545354
middle_end/flambda/naming/name_occurrences.cmi \
53555355
middle_end/flambda/types/flambda_type.cmi \
@@ -5359,7 +5359,7 @@ middle_end/flambda/lifting/lifted_constant.cmi : \
53595359
middle_end/flambda/terms/bound_symbols.cmi
53605360
middle_end/flambda/lifting/lifted_constant_state.cmo : \
53615361
middle_end/flambda/compilenv_deps/symbol.cmi \
5362-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
5362+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
53635363
middle_end/flambda/basic/name.cmi \
53645364
middle_end/flambda/lifting/lifted_constant.cmi \
53655365
middle_end/flambda/types/flambda_type.cmi \
@@ -5369,7 +5369,7 @@ middle_end/flambda/lifting/lifted_constant_state.cmo : \
53695369
middle_end/flambda/lifting/lifted_constant_state.cmi
53705370
middle_end/flambda/lifting/lifted_constant_state.cmx : \
53715371
middle_end/flambda/compilenv_deps/symbol.cmx \
5372-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
5372+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
53735373
middle_end/flambda/basic/name.cmx \
53745374
middle_end/flambda/lifting/lifted_constant.cmx \
53755375
middle_end/flambda/types/flambda_type.cmx \
@@ -5385,7 +5385,7 @@ middle_end/flambda/lifting/reification.cmo : \
53855385
middle_end/flambda/compilenv_deps/variable.cmi \
53865386
middle_end/flambda/naming/var_in_binding_pos.cmi \
53875387
middle_end/flambda/compilenv_deps/symbol.cmi \
5388-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
5388+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
53895389
middle_end/flambda/simplify/simplify_import.cmi \
53905390
middle_end/flambda/simplify/basic/simplified_named.cmi \
53915391
middle_end/flambda/basic/simple.cmi \
@@ -5401,7 +5401,7 @@ middle_end/flambda/lifting/reification.cmx : \
54015401
middle_end/flambda/compilenv_deps/variable.cmx \
54025402
middle_end/flambda/naming/var_in_binding_pos.cmx \
54035403
middle_end/flambda/compilenv_deps/symbol.cmx \
5404-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
5404+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
54055405
middle_end/flambda/simplify/simplify_import.cmx \
54065406
middle_end/flambda/simplify/basic/simplified_named.cmx \
54075407
middle_end/flambda/basic/simple.cmx \
@@ -6044,7 +6044,7 @@ middle_end/flambda/simplify/expr_builder.cmo : \
60446044
middle_end/flambda/basic/symbol_scoping_rule.cmi \
60456045
middle_end/flambda/terms/symbol_projection.cmi \
60466046
lambda/switch.cmi \
6047-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6047+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
60486048
middle_end/flambda/simplify/basic/simplified_named.cmi \
60496049
middle_end/flambda/basic/simple.cmi \
60506050
middle_end/flambda/terms/set_of_closures.cmi \
@@ -6074,7 +6074,7 @@ middle_end/flambda/simplify/expr_builder.cmx : \
60746074
middle_end/flambda/basic/symbol_scoping_rule.cmx \
60756075
middle_end/flambda/terms/symbol_projection.cmx \
60766076
lambda/switch.cmx \
6077-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
6077+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
60786078
middle_end/flambda/simplify/basic/simplified_named.cmx \
60796079
middle_end/flambda/basic/simple.cmx \
60806080
middle_end/flambda/terms/set_of_closures.cmx \
@@ -6186,7 +6186,7 @@ middle_end/flambda/simplify/simplify_apply_expr.cmo : \
61866186
middle_end/flambda/compilenv_deps/variable.cmi \
61876187
middle_end/flambda/basic/var_within_closure.cmi \
61886188
middle_end/flambda/naming/var_in_binding_pos.cmi \
6189-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6189+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
61906190
middle_end/flambda/simplify/simplify_import.cmi \
61916191
middle_end/flambda/simplify/simplify_common.cmi \
61926192
middle_end/flambda/basic/simple.cmi \
@@ -6219,7 +6219,7 @@ middle_end/flambda/simplify/simplify_apply_expr.cmx : \
62196219
middle_end/flambda/compilenv_deps/variable.cmx \
62206220
middle_end/flambda/basic/var_within_closure.cmx \
62216221
middle_end/flambda/naming/var_in_binding_pos.cmx \
6222-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
6222+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
62236223
middle_end/flambda/simplify/simplify_import.cmx \
62246224
middle_end/flambda/simplify/simplify_common.cmx \
62256225
middle_end/flambda/basic/simple.cmx \
@@ -6516,7 +6516,7 @@ middle_end/flambda/simplify/simplify_named.cmo : \
65166516
middle_end/flambda/compilenv_deps/target_imm.cmi \
65176517
middle_end/flambda/terms/symbol_projection.cmi \
65186518
middle_end/flambda/compilenv_deps/symbol.cmi \
6519-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6519+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
65206520
middle_end/flambda/simplify/simplify_static_const.cmi \
65216521
middle_end/flambda/simplify/simplify_set_of_closures.cmi \
65226522
middle_end/flambda/simplify/simplify_primitive.cmi \
@@ -6541,7 +6541,7 @@ middle_end/flambda/simplify/simplify_named.cmx : \
65416541
middle_end/flambda/compilenv_deps/target_imm.cmx \
65426542
middle_end/flambda/terms/symbol_projection.cmx \
65436543
middle_end/flambda/compilenv_deps/symbol.cmx \
6544-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
6544+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
65456545
middle_end/flambda/simplify/simplify_static_const.cmx \
65466546
middle_end/flambda/simplify/simplify_set_of_closures.cmx \
65476547
middle_end/flambda/simplify/simplify_primitive.cmx \
@@ -6632,7 +6632,7 @@ middle_end/flambda/simplify/simplify_set_of_closures.cmo : \
66326632
middle_end/flambda/naming/var_in_binding_pos.cmi \
66336633
middle_end/flambda/terms/symbol_projection.cmi \
66346634
middle_end/flambda/compilenv_deps/symbol.cmi \
6635-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6635+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
66366636
middle_end/flambda/simplify/basic/simplify_named_result.cmi \
66376637
middle_end/flambda/simplify/simplify_import.cmi \
66386638
middle_end/flambda/simplify/simplify_common.cmi \
@@ -6673,7 +6673,7 @@ middle_end/flambda/simplify/simplify_set_of_closures.cmx : \
66736673
middle_end/flambda/naming/var_in_binding_pos.cmx \
66746674
middle_end/flambda/terms/symbol_projection.cmx \
66756675
middle_end/flambda/compilenv_deps/symbol.cmx \
6676-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
6676+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
66776677
middle_end/flambda/simplify/basic/simplify_named_result.cmx \
66786678
middle_end/flambda/simplify/simplify_import.cmx \
66796679
middle_end/flambda/simplify/simplify_common.cmx \
@@ -6710,7 +6710,7 @@ middle_end/flambda/simplify/simplify_set_of_closures.cmx : \
67106710
middle_end/flambda/simplify/simplify_set_of_closures.cmi
67116711
middle_end/flambda/simplify/simplify_set_of_closures.cmi : \
67126712
middle_end/flambda/compilenv_deps/symbol.cmi \
6713-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6713+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
67146714
middle_end/flambda/simplify/basic/simplify_named_result.cmi \
67156715
middle_end/flambda/simplify/simplify_import.cmi \
67166716
middle_end/flambda/simplify/simplify_common.cmi \
@@ -6744,7 +6744,7 @@ middle_end/flambda/simplify/simplify_simple.cmi : \
67446744
middle_end/flambda/simplify/env/downwards_acc.cmi
67456745
middle_end/flambda/simplify/simplify_static_const.cmo : \
67466746
lambda/tag.cmi \
6747-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6747+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
67486748
middle_end/flambda/simplify/simplify_set_of_closures.cmi \
67496749
middle_end/flambda/simplify/simplify_import.cmi \
67506750
middle_end/flambda/basic/simple.cmi \
@@ -6759,7 +6759,7 @@ middle_end/flambda/simplify/simplify_static_const.cmo : \
67596759
middle_end/flambda/simplify/simplify_static_const.cmi
67606760
middle_end/flambda/simplify/simplify_static_const.cmx : \
67616761
lambda/tag.cmx \
6762-
middle_end/flambda/simplify/static_const_with_free_names.cmx \
6762+
middle_end/flambda/simplify/rebuilt_static_const.cmx \
67636763
middle_end/flambda/simplify/simplify_set_of_closures.cmx \
67646764
middle_end/flambda/simplify/simplify_import.cmx \
67656765
middle_end/flambda/basic/simple.cmx \
@@ -6773,7 +6773,7 @@ middle_end/flambda/simplify/simplify_static_const.cmx : \
67736773
middle_end/flambda/terms/bound_symbols.cmx \
67746774
middle_end/flambda/simplify/simplify_static_const.cmi
67756775
middle_end/flambda/simplify/simplify_static_const.cmi : \
6776-
middle_end/flambda/simplify/static_const_with_free_names.cmi \
6776+
middle_end/flambda/simplify/rebuilt_static_const.cmi \
67776777
middle_end/flambda/simplify/simplify_common.cmi \
67786778
middle_end/flambda/terms/flambda.cmi \
67796779
middle_end/flambda/simplify/env/downwards_acc.cmi \
@@ -6905,21 +6905,21 @@ middle_end/flambda/simplify/simplify_variadic_primitive.cmi : \
69056905
middle_end/flambda/terms/flambda_primitive.cmi \
69066906
middle_end/flambda/simplify/env/downwards_acc.cmi \
69076907
lambda/debuginfo.cmi
6908-
middle_end/flambda/simplify/static_const_with_free_names.cmo : \
6908+
middle_end/flambda/simplify/rebuilt_static_const.cmo : \
69096909
middle_end/flambda/types/basic/or_unknown.cmi \
69106910
middle_end/flambda/naming/name_occurrences.cmi \
69116911
utils/misc.cmi \
69126912
middle_end/flambda/terms/flambda.cmi \
69136913
middle_end/flambda/basic/code_id.cmi \
6914-
middle_end/flambda/simplify/static_const_with_free_names.cmi
6915-
middle_end/flambda/simplify/static_const_with_free_names.cmx : \
6914+
middle_end/flambda/simplify/rebuilt_static_const.cmi
6915+
middle_end/flambda/simplify/rebuilt_static_const.cmx : \
69166916
middle_end/flambda/types/basic/or_unknown.cmx \
69176917
middle_end/flambda/naming/name_occurrences.cmx \
69186918
utils/misc.cmx \
69196919
middle_end/flambda/terms/flambda.cmx \
69206920
middle_end/flambda/basic/code_id.cmx \
6921-
middle_end/flambda/simplify/static_const_with_free_names.cmi
6922-
middle_end/flambda/simplify/static_const_with_free_names.cmi : \
6921+
middle_end/flambda/simplify/rebuilt_static_const.cmi
6922+
middle_end/flambda/simplify/rebuilt_static_const.cmi : \
69236923
middle_end/flambda/compilenv_deps/symbol.cmi \
69246924
middle_end/flambda/terms/set_of_closures.cmi \
69256925
middle_end/flambda/types/basic/or_unknown.cmi \

compilerlibs/Makefile.compilerlibs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ MIDDLE_END_FLAMBDA_SIMPLIFY=\
302302
middle_end/flambda/simplify/env/continuation_env_and_param_types.cmo \
303303
middle_end/flambda/simplify/basic/continuation_in_env.cmo \
304304
middle_end/flambda/simplify/basic/simplified_named.cmo \
305-
middle_end/flambda/simplify/static_const_with_free_names.cmo \
305+
middle_end/flambda/simplify/rebuilt_static_const.cmo \
306306
middle_end/flambda/simplify/common_subexpression_elimination.cmo \
307307
middle_end/flambda/simplify/env/downwards_env.cmo \
308308
middle_end/flambda/simplify/env/upwards_env.cmo \

middle_end/flambda/lifting/lifted_constant.ml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module Definition = struct
3636

3737
type t = {
3838
descr : descr;
39-
defining_expr : Static_const_with_free_names.t;
39+
defining_expr : Rebuilt_static_const.t;
4040
}
4141

4242
let binds_symbol t sym =
@@ -49,7 +49,7 @@ module Definition = struct
4949

5050
let free_names t =
5151
match t.descr with
52-
| Code _ -> Static_const_with_free_names.free_names t.defining_expr
52+
| Code _ -> Rebuilt_static_const.free_names t.defining_expr
5353
| Set_of_closures { symbol_projections; _ }
5454
| Block_like { symbol_projections; _ } ->
5555
(* The symbols mentioned in any symbol projections must be counted
@@ -59,7 +59,7 @@ module Definition = struct
5959
Name_occurrences.add_symbol free_names
6060
(Symbol_projection.symbol proj) Name_mode.normal)
6161
symbol_projections
62-
(Static_const_with_free_names.free_names t.defining_expr)
62+
(Rebuilt_static_const.free_names t.defining_expr)
6363

6464
let print_descr ppf descr =
6565
match descr with
@@ -80,7 +80,7 @@ module Definition = struct
8080
@[<hov 1>(defining_expr@ %a)@]\
8181
@]"
8282
print_descr descr
83-
Static_const_with_free_names.print defining_expr
83+
Rebuilt_static_const.print defining_expr
8484

8585
let descr t = t.descr
8686
let defining_expr t = t.defining_expr
@@ -92,7 +92,7 @@ module Definition = struct
9292
| Block_like { symbol_projections; _ } -> symbol_projections
9393

9494
let code code_id defining_expr =
95-
match Static_const_with_free_names.const defining_expr with
95+
match Rebuilt_static_const.const defining_expr with
9696
| Code code ->
9797
if Code_id.equal code_id (Code.code_id code) then
9898
{ descr = Code code_id;
@@ -104,7 +104,7 @@ module Definition = struct
104104
Code_id.print (Code.code_id code)
105105
| _ ->
106106
Misc.fatal_errorf "Not a code definition: %a"
107-
Static_const_with_free_names.print defining_expr
107+
Rebuilt_static_const.print defining_expr
108108

109109
let set_of_closures denv ~closure_symbols_with_types
110110
~symbol_projections defining_expr =
@@ -157,7 +157,7 @@ end
157157
type t = {
158158
definitions : Definition.t list;
159159
bound_symbols : Bound_symbols.t;
160-
defining_exprs : Static_const_with_free_names.Group.t;
160+
defining_exprs : Rebuilt_static_const.Group.t;
161161
symbol_projections : Symbol_projection.t Variable.Map.t;
162162
is_fully_static : bool;
163163
}
@@ -166,7 +166,7 @@ let definitions t = t.definitions
166166
let symbol_projections t = t.symbol_projections
167167

168168
let free_names_of_defining_exprs t =
169-
Static_const_with_free_names.Group.free_names t.defining_exprs
169+
Rebuilt_static_const.Group.free_names t.defining_exprs
170170

171171
let is_fully_static t = t.is_fully_static
172172

@@ -183,7 +183,7 @@ let compute_bound_symbols definitions =
183183

184184
let compute_defining_exprs definitions =
185185
ListLabels.map definitions ~f:Definition.defining_expr
186-
|> Static_const_with_free_names.Group.create
186+
|> Rebuilt_static_const.Group.create
187187

188188
let create_block_like symbol ~symbol_projections defining_expr denv ty =
189189
(* CR mshinwell: check that [defining_expr] is not a set of closures
@@ -196,7 +196,7 @@ let create_block_like symbol ~symbol_projections defining_expr denv ty =
196196
bound_symbols = compute_bound_symbols definitions;
197197
defining_exprs = compute_defining_exprs definitions;
198198
is_fully_static =
199-
Static_const_with_free_names.is_fully_static defining_expr;
199+
Rebuilt_static_const.is_fully_static defining_expr;
200200
symbol_projections = Definition.symbol_projections definition;
201201
}
202202

@@ -211,7 +211,7 @@ let create_set_of_closures denv ~closure_symbols_with_types
211211
bound_symbols = compute_bound_symbols definitions;
212212
defining_exprs = compute_defining_exprs definitions;
213213
is_fully_static =
214-
Static_const_with_free_names.is_fully_static defining_expr;
214+
Rebuilt_static_const.is_fully_static defining_expr;
215215
symbol_projections = Definition.symbol_projections definition;
216216
}
217217

@@ -222,7 +222,7 @@ let create_code code_id defining_expr =
222222
bound_symbols = compute_bound_symbols definitions;
223223
defining_exprs = compute_defining_exprs definitions;
224224
is_fully_static =
225-
Static_const_with_free_names.is_fully_static defining_expr;
225+
Rebuilt_static_const.is_fully_static defining_expr;
226226
symbol_projections = Definition.symbol_projections definition;
227227
}
228228

@@ -241,9 +241,9 @@ let concat ts =
241241
in
242242
let defining_exprs =
243243
List.fold_left (fun defining_exprs t ->
244-
Static_const_with_free_names.Group.concat t.defining_exprs
244+
Rebuilt_static_const.Group.concat t.defining_exprs
245245
defining_exprs)
246-
Static_const_with_free_names.Group.empty
246+
Rebuilt_static_const.Group.empty
247247
ts
248248
in
249249
let is_fully_static =
@@ -267,7 +267,7 @@ let concat ts =
267267
}
268268

269269
let defining_exprs t =
270-
Static_const_with_free_names.Group.create
270+
Rebuilt_static_const.Group.create
271271
(List.map Definition.defining_expr t.definitions)
272272

273273
let bound_symbols t =
@@ -298,19 +298,19 @@ let apply_projection t proj =
298298
let simple =
299299
match
300300
Symbol_projection.projection proj,
301-
Static_const_with_free_names.const defining_expr
301+
Rebuilt_static_const.const defining_expr
302302
with
303303
| Block_load { index; }, Block (tag, mut, fields) ->
304304
if not (Tag.Scannable.equal tag Tag.Scannable.zero) then begin
305305
Misc.fatal_errorf "Symbol projection@ %a@ on block which doesn't \
306306
have tag zero:@ %a"
307307
Symbol_projection.print proj
308-
Static_const_with_free_names.print defining_expr
308+
Rebuilt_static_const.print defining_expr
309309
end;
310310
if Mutability.is_mutable mut then begin
311311
Misc.fatal_errorf "Symbol projection@ %a@ on mutable block:@ %a"
312312
Symbol_projection.print proj
313-
Static_const_with_free_names.print defining_expr
313+
Rebuilt_static_const.print defining_expr
314314
end;
315315
let index = Targetint.OCaml.to_int_exn index in
316316
begin match List.nth_opt fields index with
@@ -325,7 +325,7 @@ let apply_projection t proj =
325325
Misc.fatal_errorf "Symbol projection@ %a@ has out-of-range \
326326
index:@ %a"
327327
Symbol_projection.print proj
328-
Static_const_with_free_names.print defining_expr
328+
Rebuilt_static_const.print defining_expr
329329
end;
330330
| Project_var { project_from; var; }, Set_of_closures set ->
331331
let decls = Set_of_closures.function_decls set in
@@ -334,15 +334,15 @@ let apply_projection t proj =
334334
Misc.fatal_errorf "Symbol projection@ %a@ has closure ID not \
335335
bound by this set of closures:@ %a"
336336
Symbol_projection.print proj
337-
Static_const_with_free_names.print defining_expr
337+
Rebuilt_static_const.print defining_expr
338338
end;
339339
let closure_env = Set_of_closures.closure_elements set in
340340
begin match Var_within_closure.Map.find var closure_env with
341341
| exception Not_found ->
342342
Misc.fatal_errorf "Symbol projection@ %a@ has closure var not \
343343
defined in the environment of this set of closures:@ %a"
344344
Symbol_projection.print proj
345-
Static_const_with_free_names.print defining_expr
345+
Rebuilt_static_const.print defining_expr
346346
| closure_entry -> closure_entry
347347
end
348348
| Block_load _,
@@ -355,7 +355,7 @@ let apply_projection t proj =
355355
| Immutable_float_array _ | Mutable_string _ | Immutable_string _) ->
356356
Misc.fatal_errorf "Symbol projection@ %a@ cannot be applied to:@ %a"
357357
Symbol_projection.print proj
358-
Static_const_with_free_names.print defining_expr
358+
Rebuilt_static_const.print defining_expr
359359
in
360360
Some simple
361361
| [] -> None

0 commit comments

Comments
 (0)