Skip to content

Commit 2734d1c

Browse files
committed
Don't redefine switch_names.
1 parent 99ae454 commit 2734d1c

File tree

5 files changed

+15
-39
lines changed

5 files changed

+15
-39
lines changed

jscomp/core/lam.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ type apply_status =
3131

3232

3333
module Types = struct
34-
type switch_names = {consts: string array; blocks: string array}
3534

3635
type lambda_switch =
3736
{ sw_numconsts: bool; (* TODO: refine its representation *)
3837
sw_consts: (int * t) list;
3938
sw_numblocks: bool;
4039
sw_blocks: (int * t) list;
4140
sw_failaction : t option;
42-
sw_names : switch_names option }
41+
sw_names : Lambda.switch_names option }
4342
(*
4443
Invariant:
4544
length (sw_consts) <= sw_numconsts
@@ -109,7 +108,6 @@ module Types = struct
109108
end
110109

111110
module X = struct
112-
type switch_names = Types.switch_names = {consts: string array; blocks: string array}
113111

114112
type lambda_switch
115113
= Types.lambda_switch
@@ -119,7 +117,7 @@ module X = struct
119117
sw_numblocks: bool;
120118
sw_blocks: (int * t) list;
121119
sw_failaction: t option;
122-
sw_names: switch_names option }
120+
sw_names: Lambda.switch_names option }
123121
and prim_info
124122
= Types.prim_info
125123
=

jscomp/core/lam.mli

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828

2929
type ident = Ident.t
3030

31-
type switch_names = {consts: string array; blocks: string array}
32-
3331
type lambda_switch =
3432
{ sw_numconsts: bool;
3533
sw_consts: (int * t) list;
3634
sw_numblocks: bool;
3735
sw_blocks: (int * t) list;
3836
sw_failaction: t option;
39-
sw_names: switch_names option }
37+
sw_names: Lambda.switch_names option }
4038
and apply_status =
4139
| App_na
4240
| App_ml_full

jscomp/core/lam_convert.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,10 +758,6 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
758758
Lam.apply f [x] outer_loc App_na
759759
and convert_switch (e : Lambda.lambda) (s : Lambda.lambda_switch) =
760760
let e = convert_aux e in
761-
let sw_names = match s.sw_names with
762-
| None -> None
763-
| Some {consts; blocks} ->
764-
Some {Lam.consts; blocks} in
765761
match s with
766762
| {
767763
sw_failaction = None ;
@@ -786,7 +782,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
786782
Ext_list.map_snd sw_consts convert_aux;
787783
sw_numconsts =
788784
Ext_list.length_ge sw_consts sw_numconsts;
789-
sw_names;
785+
sw_names = s.sw_names;
790786
}
791787
end
792788
| _ ->
@@ -796,7 +792,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
796792
sw_numblocks = Ext_list.length_ge s.sw_blocks s.sw_numblocks;
797793
sw_blocks = Ext_list.map_snd s.sw_blocks convert_aux;
798794
sw_failaction =Ext_option.map s.sw_failaction convert_aux;
799-
sw_names; } in
795+
sw_names = s.sw_names } in
800796
convert_aux lam , may_depends
801797

802798

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74127,15 +74127,13 @@ module Lam : sig
7412774127

7412874128
type ident = Ident.t
7412974129

74130-
type switch_names = {consts: string array; blocks: string array}
74131-
7413274130
type lambda_switch =
7413374131
{ sw_numconsts: bool;
7413474132
sw_consts: (int * t) list;
7413574133
sw_numblocks: bool;
7413674134
sw_blocks: (int * t) list;
7413774135
sw_failaction: t option;
74138-
sw_names: switch_names option }
74136+
sw_names: Lambda.switch_names option }
7413974137
and apply_status =
7414074138
| App_na
7414174139
| App_ml_full
@@ -74298,15 +74296,14 @@ type apply_status =
7429874296

7429974297

7430074298
module Types = struct
74301-
type switch_names = {consts: string array; blocks: string array}
7430274299

7430374300
type lambda_switch =
7430474301
{ sw_numconsts: bool; (* TODO: refine its representation *)
7430574302
sw_consts: (int * t) list;
7430674303
sw_numblocks: bool;
7430774304
sw_blocks: (int * t) list;
7430874305
sw_failaction : t option;
74309-
sw_names : switch_names option }
74306+
sw_names : Lambda.switch_names option }
7431074307
(*
7431174308
Invariant:
7431274309
length (sw_consts) <= sw_numconsts
@@ -74376,7 +74373,6 @@ module Types = struct
7437674373
end
7437774374

7437874375
module X = struct
74379-
type switch_names = Types.switch_names = {consts: string array; blocks: string array}
7438074376

7438174377
type lambda_switch
7438274378
= Types.lambda_switch
@@ -74386,7 +74382,7 @@ module X = struct
7438674382
sw_numblocks: bool;
7438774383
sw_blocks: (int * t) list;
7438874384
sw_failaction: t option;
74389-
sw_names: switch_names option }
74385+
sw_names: Lambda.switch_names option }
7439074386
and prim_info
7439174387
= Types.prim_info
7439274388
=
@@ -113366,10 +113362,6 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
113366113362
Lam.apply f [x] outer_loc App_na
113367113363
and convert_switch (e : Lambda.lambda) (s : Lambda.lambda_switch) =
113368113364
let e = convert_aux e in
113369-
let sw_names = match s.sw_names with
113370-
| None -> None
113371-
| Some {consts; blocks} ->
113372-
Some {Lam.consts; blocks} in
113373113365
match s with
113374113366
| {
113375113367
sw_failaction = None ;
@@ -113394,7 +113386,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
113394113386
Ext_list.map_snd sw_consts convert_aux;
113395113387
sw_numconsts =
113396113388
Ext_list.length_ge sw_consts sw_numconsts;
113397-
sw_names;
113389+
sw_names = s.sw_names;
113398113390
}
113399113391
end
113400113392
| _ ->
@@ -113404,7 +113396,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
113404113396
sw_numblocks = Ext_list.length_ge s.sw_blocks s.sw_numblocks;
113405113397
sw_blocks = Ext_list.map_snd s.sw_blocks convert_aux;
113406113398
sw_failaction =Ext_option.map s.sw_failaction convert_aux;
113407-
sw_names; } in
113399+
sw_names = s.sw_names } in
113408113400
convert_aux lam , may_depends
113409113401

113410113402

lib/4.02.3/whole_compiler.ml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65700,15 +65700,13 @@ module Lam : sig
6570065700

6570165701
type ident = Ident.t
6570265702

65703-
type switch_names = {consts: string array; blocks: string array}
65704-
6570565703
type lambda_switch =
6570665704
{ sw_numconsts: bool;
6570765705
sw_consts: (int * t) list;
6570865706
sw_numblocks: bool;
6570965707
sw_blocks: (int * t) list;
6571065708
sw_failaction: t option;
65711-
sw_names: switch_names option }
65709+
sw_names: Lambda.switch_names option }
6571265710
and apply_status =
6571365711
| App_na
6571465712
| App_ml_full
@@ -65871,15 +65869,14 @@ type apply_status =
6587165869

6587265870

6587365871
module Types = struct
65874-
type switch_names = {consts: string array; blocks: string array}
6587565872

6587665873
type lambda_switch =
6587765874
{ sw_numconsts: bool; (* TODO: refine its representation *)
6587865875
sw_consts: (int * t) list;
6587965876
sw_numblocks: bool;
6588065877
sw_blocks: (int * t) list;
6588165878
sw_failaction : t option;
65882-
sw_names : switch_names option }
65879+
sw_names : Lambda.switch_names option }
6588365880
(*
6588465881
Invariant:
6588565882
length (sw_consts) <= sw_numconsts
@@ -65949,7 +65946,6 @@ module Types = struct
6594965946
end
6595065947

6595165948
module X = struct
65952-
type switch_names = Types.switch_names = {consts: string array; blocks: string array}
6595365949

6595465950
type lambda_switch
6595565951
= Types.lambda_switch
@@ -65959,7 +65955,7 @@ module X = struct
6595965955
sw_numblocks: bool;
6596065956
sw_blocks: (int * t) list;
6596165957
sw_failaction: t option;
65962-
sw_names: switch_names option }
65958+
sw_names: Lambda.switch_names option }
6596365959
and prim_info
6596465960
= Types.prim_info
6596565961
=
@@ -111075,10 +111071,6 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
111075111071
Lam.apply f [x] outer_loc App_na
111076111072
and convert_switch (e : Lambda.lambda) (s : Lambda.lambda_switch) =
111077111073
let e = convert_aux e in
111078-
let sw_names = match s.sw_names with
111079-
| None -> None
111080-
| Some {consts; blocks} ->
111081-
Some {Lam.consts; blocks} in
111082111074
match s with
111083111075
| {
111084111076
sw_failaction = None ;
@@ -111103,7 +111095,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
111103111095
Ext_list.map_snd sw_consts convert_aux;
111104111096
sw_numconsts =
111105111097
Ext_list.length_ge sw_consts sw_numconsts;
111106-
sw_names;
111098+
sw_names = s.sw_names;
111107111099
}
111108111100
end
111109111101
| _ ->
@@ -111113,7 +111105,7 @@ let convert (exports : Ident_set.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
111113111105
sw_numblocks = Ext_list.length_ge s.sw_blocks s.sw_numblocks;
111114111106
sw_blocks = Ext_list.map_snd s.sw_blocks convert_aux;
111115111107
sw_failaction =Ext_option.map s.sw_failaction convert_aux;
111116-
sw_names; } in
111108+
sw_names = s.sw_names } in
111117111109
convert_aux lam , may_depends
111118111110

111119111111

0 commit comments

Comments
 (0)