Skip to content

Commit bb7665b

Browse files
committed
Cleanup: Remove unused stub.
1 parent 1f9eeb5 commit bb7665b

File tree

6 files changed

+6
-17
lines changed

6 files changed

+6
-17
lines changed

jscomp/ml/lambda.ml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ type let_kind = Strict | Alias | StrictOpt | Variable
320320
type function_attribute = {
321321
inline : inline_attribute;
322322
is_a_functor: bool;
323-
stub: bool;
324323
return_unit : bool;
325324
async : bool;
326325
directive : string option;
@@ -391,16 +390,12 @@ let lambda_unit = Lconst const_unit
391390
let default_function_attribute = {
392391
inline = Default_inline;
393392
is_a_functor = false;
394-
stub = false;
395393
return_unit = false;
396394
async = false;
397395
oneUnitArg = false;
398396
directive = None;
399397
}
400398

401-
let default_stub_attribute =
402-
{ default_function_attribute with stub = true }
403-
404399
(* Build sharing keys *)
405400
(*
406401
Those keys are later compared with Pervasives.compare.

jscomp/ml/lambda.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ type let_kind = Strict | Alias | StrictOpt | Variable
290290
type function_attribute = {
291291
inline : inline_attribute;
292292
is_a_functor: bool;
293-
stub: bool;
294293
return_unit : bool;
295294
async : bool;
296295
directive : string option;
@@ -387,7 +386,6 @@ val commute_comparison : comparison -> comparison
387386
val negate_comparison : comparison -> comparison
388387

389388
val default_function_attribute : function_attribute
390-
val default_stub_attribute : function_attribute
391389

392390
(***********************)
393391
(* For static failures *)

jscomp/ml/printlambda.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,9 @@ let name_of_primitive = function
345345
| Popaque -> "Popaque"
346346
| Pcreate_extension _ -> "Pcreate_extension"
347347

348-
let function_attribute ppf { inline; is_a_functor; stub; return_unit } =
348+
let function_attribute ppf { inline; is_a_functor; return_unit } =
349349
if is_a_functor then
350350
fprintf ppf "is_a_functor@ ";
351-
if stub then
352-
fprintf ppf "stub@ ";
353351
if return_unit then
354352
fprintf ppf "void@ ";
355353
begin match inline with

jscomp/ml/translattribute.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let get_inline_attribute l =
6565
let rec add_inline_attribute (expr : Lambda.lambda) loc attributes =
6666
match (expr, get_inline_attribute attributes) with
6767
| expr, Default_inline -> expr
68-
| Lfunction ({ attr = { stub = false } as attr } as funct), inline ->
68+
| Lfunction ({ attr } as funct), inline ->
6969
(match attr.inline with
7070
| Default_inline -> ()
7171
| Always_inline | Never_inline ->

jscomp/ml/translcore.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ let transl_primitive loc p env ty =
471471
params = [ parm ];
472472
body = Matching.inline_lazy_force (Lvar parm) Location.none;
473473
loc;
474-
attr = default_stub_attribute;
474+
attr = default_function_attribute;
475475
}
476476
| Ploc kind -> (
477477
let lam = lam_of_loc kind loc in
@@ -483,7 +483,7 @@ let transl_primitive loc p env ty =
483483
Lfunction
484484
{
485485
params = [ param ];
486-
attr = default_stub_attribute;
486+
attr = default_function_attribute;
487487
loc;
488488
body = Lprim (Pmakeblock Blk_tuple, [ lam; Lvar param ], loc);
489489
}
@@ -505,7 +505,7 @@ let transl_primitive loc p env ty =
505505
Lfunction
506506
{
507507
params;
508-
attr = default_stub_attribute;
508+
attr = default_function_attribute;
509509
loc;
510510
body = Lprim (prim, List.map (fun id -> Lvar id) params, loc);
511511
}
@@ -1078,7 +1078,7 @@ and transl_apply ?(inlined = Default_inline) ?(uncurried_partial_application=Non
10781078
{
10791079
params = [ id_arg ];
10801080
body = lam;
1081-
attr = default_stub_attribute;
1081+
attr = default_function_attribute;
10821082
loc;
10831083
}
10841084
in

jscomp/ml/translmod.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ and apply_coercion_result loc strict funct params args cc_res =
9898
{
9999
Lambda.default_function_attribute with
100100
is_a_functor = true;
101-
stub = true;
102101
};
103102
loc;
104103
body =
@@ -274,7 +273,6 @@ let rec compile_functor mexp coercion root_path loc =
274273
{
275274
inline = inline_attribute;
276275
is_a_functor = true;
277-
stub = false;
278276
return_unit = false;
279277
async = false;
280278
oneUnitArg = false;

0 commit comments

Comments
 (0)