Skip to content

Commit 5e86da8

Browse files
committed
remove unused code
1 parent 38b3017 commit 5e86da8

9 files changed

+8
-15
lines changed

jscomp/core/js_dump.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ and expression_desc cxt ~(level:int) f x : cxt =
863863
&& not_is_cons then
864864
pp_comment_option f (Some p.name);
865865
expression_desc cxt ~level f (Object objs)
866-
| Caml_block ( _, _, _, (Blk_module_export | Blk_na _ )) -> assert false
866+
| Caml_block ( _, _, _, (Blk_module_export )) -> assert false
867867
| Caml_block( el, mutable_flag, _tag, (Blk_tuple | Blk_class | Blk_array ))
868868
->
869869
expression_desc cxt ~level f (Array (el, mutable_flag))

jscomp/core/js_exp_make.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ let dummy_obj ?comment (info : Lam_tag_info.t) : t =
270270
->
271271
{comment ; expression_desc = Object []}
272272
| Blk_tuple | Blk_array
273-
| Blk_na _
273+
274274
| Blk_class | Blk_module_export
275275
->
276276
{comment ; expression_desc = Array ([],Mutable)}

jscomp/core/lam_compile_util.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ let comment_of_tag_info (x : Lam_tag_info.t) =
6060
None
6161
| Blk_extension (* TODO: enhance it later *)
6262
-> None
63-
| Blk_na s -> if s = "" then None else Some s
63+
6464

6565
(* let module_alias = Some "alias" *)

jscomp/core/lam_constant_convert.ml

-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ let rec convert_constant ( const : Lambda.structured_constant) : Lam_constant.t
103103
Const_block (i,t, Ext_list.map xs convert_constant )
104104
| Blk_lazy_general
105105
-> assert false
106-
| Blk_na s ->
107-
let t : Lam_tag_info.t = Blk_na s in
108-
Const_block (i,t, Ext_list.map xs convert_constant )
109106

110107
| Blk_record_inlined {name;fields;num_nonconst} ->
111108
let t : Lam_tag_info.t = Blk_record_inlined {name;fields;num_nonconst} in

jscomp/core/lam_convert.ml

-3
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,6 @@ let lam_prim ~primitive:( p : Lambda.primitive) ~args loc : Lam.t =
304304

305305
| _ -> assert false
306306
end
307-
| Blk_na s ->
308-
let info : Lam_tag_info.t = Blk_na s in
309-
prim ~primitive:(Pmakeblock (tag,info,mutable_flag)) ~args loc
310307
end
311308
| Pfield (id,info)
312309
-> prim ~primitive:(Pfield (id,info)) ~args loc

jscomp/core/lam_tag_info.ml

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type t =
3434
| Blk_record of string array
3535
| Blk_module of string list
3636
| Blk_extension
37-
| Blk_na of string (* for debugging *)
3837
| Blk_record_ext of string array
3938
| Blk_record_inlined of { name : string ; num_nonconst : int; fields : string array }
4039
| Blk_constructor of {name : string ; num_nonconst : int}

jscomp/ml/lambda.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ type tag_info =
4444
| Blk_module_export of Ident.t list
4545
| Blk_extension_slot
4646
| Blk_extension
47-
| Blk_na of string
47+
4848
| Blk_some
4949
| Blk_some_not_nested (* ['a option] where ['a] can not inhabit a non-like value *)
5050
| Blk_record_inlined of { name : string ; num_nonconst : int; fields : string array}
5151
| Blk_record_ext of string array
5252
| Blk_lazy_general
5353
| Blk_class (* Ocaml style class*)
5454

55-
let default_tag_info : tag_info = Blk_na ""
55+
5656
let blk_record = ref (fun fields ->
5757
let all_labels_info = fields |> Array.map (fun (x,_) -> x.Types.lbl_name) in
5858
Blk_record all_labels_info

jscomp/ml/lambda.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type tag_info =
5454
]}
5555
5656
*)
57-
| Blk_na of string (* This string only for debugging*)
57+
5858
| Blk_some
5959
| Blk_some_not_nested (* ['a option] where ['a] can not inhabit a non-like value *)
6060
| Blk_record_inlined of { name : string ; num_nonconst : int ; fields : string array}
@@ -82,7 +82,7 @@ val blk_record_inlined :
8282
tag_info
8383
) ref
8484

85-
val default_tag_info : tag_info
85+
8686

8787
val ref_tag_info : tag_info
8888

jscomp/ml/printlambda.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ let print_taginfo ppf = function
126126
| Blk_record ss -> fprintf ppf "[%s]" (String.concat ";" (Array.to_list ss) )
127127
| Blk_module ss -> fprintf ppf "[%s]" (String.concat ";" ss)
128128
| Blk_extension_slot -> fprintf ppf "ext_slot"
129-
| Blk_na s -> fprintf ppf "%s" s
129+
130130
| Blk_some -> fprintf ppf "some"
131131
| Blk_some_not_nested -> fprintf ppf "some_not_nested"
132132
| Blk_lazy_general -> fprintf ppf "lazy_general"

0 commit comments

Comments
 (0)