Skip to content

Commit fe3dfd9

Browse files
cknittclaude
andcommitted
Remove code that recent master changes left unused
After rebasing onto master (Rust rewatch removal, flat lib/rescript), master's new code still matched Lambda.Pis_undefined, which this branch removes as never produced, and make dead-code reported: - Js_exp_make.of_block ?e, and the test helpers' module_ ?interface and publish ?has_interface: never passed; removed. - Cmi_format.input_cmi and Build_session.iter_package_plans: never used. - Package_plan.t.source_files: never read; removed with its two writes. The two Pis_undefined arms (Lambda, Lam_analysis) go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gLDo8mBJKpNE25WAwT Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent ac0494e commit fe3dfd9

14 files changed

Lines changed: 12 additions & 37 deletions

‎compiler/core/js_exp_make.ml‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ let bigint_mod ~checked (e0 : t) (e1 : t) =
17701770
(* TODO -- alpha conversion
17711771
remember to add parens..
17721772
*)
1773-
let of_block ?e block : t =
1773+
let of_block block : t =
17741774
let return_unit = false in
17751775
(* This case is not hit that much*)
17761776
call ~info:Js_call_info.ml_full_call
@@ -1782,18 +1782,7 @@ let of_block ?e block : t =
17821782
{
17831783
is_method = false;
17841784
params = [];
1785-
body =
1786-
(match e with
1787-
| None -> block
1788-
| Some e ->
1789-
Ext_list.append block
1790-
[
1791-
{
1792-
J.statement_desc = Return e;
1793-
comment = None;
1794-
source_loc = None;
1795-
};
1796-
]);
1785+
body = block;
17971786
env = Js_fun_env.make 0;
17981787
return_unit;
17991788
async = false;

‎compiler/core/js_exp_make.mli‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ val in_ : t -> t -> t
307307

308308
val dummy_obj : Lambda.tag_info -> t
309309

310-
val of_block : ?e:J.expression -> J.statement list -> t
310+
val of_block : J.statement list -> t
311311
(** convert a block to expresion by using IIFE *)
312312

313313
val raw_js_code : Js_raw_info.code_info -> string -> t

‎compiler/core/lam_analysis.ml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ let rec delay_safe ~assignable (lam : Lambda.t) : bool =
174174
| Pasrbigint | Pbigintcomp _ | Pbigintorder | Pbigintmin | Pbigintmax
175175
| Phash_mixint | Phash_mixstring | Phash_finalmix | Pis_null_undefined
176176
| Pjscomp _ | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null
177-
| Pis_undefined | Pis_not_none | Pval_from_option
178-
| Pval_from_option_not_nest | Pis_poly_var_block ->
177+
| Pis_not_none | Pval_from_option | Pval_from_option_not_nest
178+
| Pis_poly_var_block ->
179179
true
180180
(* reads of the heap, and primitives with side effects *)
181181
| Pfield (_, (Fld_record _ | Fld_record_inline _ | Fld_record_extension _))

‎compiler/ml/cmi_format.ml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ type cmi_infos = {
2929
cmi_flags: pers_flags list;
3030
}
3131

32-
let input_cmi ic =
33-
let name, sign = input_value ic in
34-
let crcs = input_value ic in
35-
let flags = input_value ic in
36-
{cmi_name = name; cmi_sign = sign; cmi_crcs = crcs; cmi_flags = flags}
37-
3832
(* Earlier compilers wrote OCaml-style magic numbers *)
3933
let legacy_magic_prefix = "Caml1999I"
4034

‎compiler/ml/cmi_format.mli‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type cmi_infos = {
2525
val create_cmi : ?check_exists:unit -> string -> cmi_infos -> Digest.t
2626

2727
(* read the cmi information (the magic is supposed to have already been read) *)
28-
val input_cmi : in_channel -> cmi_infos
2928

3029
(* read a cmi from a filename, checking the magic *)
3130
val read_cmi : string -> cmi_infos

‎compiler/ml/lambda.ml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,9 @@ let may_skip_operands (primitive : primitive) =
740740
| Pdict_has | Pawait | Pimport _ | Pinit_mod | Pupdate_mod | Phash
741741
| Phash_mixint | Phash_mixstring | Phash_finalmix | Pis_null_undefined
742742
| Pcreate_extension _ | Pjscomp _ | Pnull_to_opt | Pnull_undefined_to_opt
743-
| Pis_null | Pis_undefined | Pis_not_none | Pval_from_option
744-
| Pval_from_option_not_nest | Pis_poly_var_block | Praw_js_code _
745-
| Pjs_fn_method | Ptagged_template _ | Ptemplate _ | Pdict_spread
746-
| Parray_spread | Plist_spread ->
743+
| Pis_null | Pis_not_none | Pval_from_option | Pval_from_option_not_nest
744+
| Pis_poly_var_block | Praw_js_code _ | Pjs_fn_method | Ptagged_template _
745+
| Ptemplate _ | Pdict_spread | Parray_spread | Plist_spread ->
747746
false
748747

749748
(* Whether [primitive] on [args], the arguments of a call, evaluates them as

‎rewatch-ocaml/build_session.ml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ let add_package_plan session package =
106106

107107
let find_package_plan session root = Hashtbl.find_opt session.package_plans root
108108

109-
let iter_package_plans session f = Hashtbl.iter f session.package_plans
110109
let package_plan_values session = Hashtbl.to_seq_values session.package_plans
111110

112111
let add_source_reference session normalized_path source =

‎rewatch-ocaml/build_session.mli‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ val invalidate_graph_cycle : t -> unit
4242
val set_graph_cycle : t -> Module_graph.cycle_info option -> unit
4343
val add_package_plan : t -> Package_plan.t -> unit
4444
val find_package_plan : t -> string -> Package_plan.t option
45-
val iter_package_plans : t -> (string -> Package_plan.t -> unit) -> unit
4645
val package_plan_values : t -> Package_plan.t Seq.t
4746
val add_source_reference : t -> string -> source_reference -> unit
4847
val find_source_reference : t -> string -> source_reference option

‎rewatch-ocaml/package_graph.ml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ let discover ~(root_config : Config.t) ~(workspace_config : Config.t) ~prod
145145
dependencies);
146146
modules;
147147
source_mtimes;
148-
source_files = discovery.inventory_files;
149148
present_source_files = discovery.present_files;
150149
}
151150
in

‎rewatch-ocaml/package_plan.ml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type t = {
1515
gentype_dependency_args: string list;
1616
modules: Source.module_ list;
1717
source_mtimes: (string, float) Hashtbl.t;
18-
source_files: string list;
1918
present_source_files: string list;
2019
}
2120

0 commit comments

Comments
 (0)