Skip to content

Commit 070d57f

Browse files
authored
flambda-backend: Remove mode from Texp_send (#1893)
1 parent 7d9ef46 commit 070d57f

File tree

10 files changed

+14
-21
lines changed

10 files changed

+14
-21
lines changed

lambda/translcore.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,10 @@ and transl_exp0 ~in_new_scope ~scopes sort e =
697697
for_body = event_before ~scopes for_body
698698
(maybe_region_layout layout_unit body);
699699
}
700-
| Texp_send(expr, met, pos, alloc_mode) ->
700+
| Texp_send(expr, met, pos) ->
701701
let lam =
702702
let pos = transl_apply_position pos in
703-
let mode = transl_alloc_mode alloc_mode in
703+
let mode = Lambda.alloc_heap in
704704
let loc = of_location ~scopes e.exp_loc in
705705
let layout = layout_exp sort e in
706706
match met with

typing/printtyped.ml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,17 +478,14 @@ and expression i ppf x =
478478
expression i ppf for_from;
479479
expression i ppf for_to;
480480
expression i ppf for_body
481-
| Texp_send (e, Tmeth_name s, _, am) ->
481+
| Texp_send (e, Tmeth_name s, _) ->
482482
line i ppf "Texp_send \"%s\"\n" s;
483-
alloc_mode i ppf am;
484483
expression i ppf e
485-
| Texp_send (e, Tmeth_val s, _, am) ->
484+
| Texp_send (e, Tmeth_val s, _) ->
486485
line i ppf "Texp_send \"%a\"\n" fmt_ident s;
487-
alloc_mode i ppf am;
488486
expression i ppf e
489-
| Texp_send (e, Tmeth_ancestor(s, _), _, am) ->
487+
| Texp_send (e, Tmeth_ancestor(s, _), _) ->
490488
line i ppf "Texp_send \"%a\"\n" fmt_ident s;
491-
alloc_mode i ppf am;
492489
expression i ppf e
493490
| Texp_new (li, _, _, _) -> line i ppf "Texp_new %a\n" fmt_path li;
494491
| Texp_setinstvar (_, s, _, e) ->

typing/rec_check.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ let rec expression : Typedtree.expression -> term_judg =
709709
expression wh_cond << Dereference;
710710
expression wh_body << Guard;
711711
]
712-
| Texp_send (e1, _, _, _) ->
712+
| Texp_send (e1, _, _) ->
713713
(*
714714
G |- e: m[Dereference]
715715
---------------------- (plus weird 'eo' option)

typing/tast_iterator.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ let expr sub {exp_extra; exp_desc; exp_env; _} =
269269
sub.expr sub for_from;
270270
sub.expr sub for_to;
271271
sub.expr sub for_body
272-
| Texp_send (exp, _, _, _) ->
272+
| Texp_send (exp, _, _) ->
273273
sub.expr sub exp
274274
| Texp_new _ -> ()
275275
| Texp_instvar _ -> ()

typing/tast_mapper.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,12 @@ let expr sub x =
384384
Texp_for {tf with for_from = sub.expr sub tf.for_from;
385385
for_to = sub.expr sub tf.for_to;
386386
for_body = sub.expr sub tf.for_body}
387-
| Texp_send (exp, meth, ap, am) ->
387+
| Texp_send (exp, meth, ap) ->
388388
Texp_send
389389
(
390390
sub.expr sub exp,
391391
meth,
392-
ap,
393-
am
392+
ap
394393
)
395394
| Texp_new _
396395
| Texp_instvar _ as d -> d

typing/typecore.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5570,9 +5570,7 @@ and type_expect_
55705570
assert false
55715571
in
55725572
rue {
5573-
exp_desc = Texp_send(obj, meth, pm.apply_position,
5574-
register_allocation expected_mode
5575-
);
5573+
exp_desc = Texp_send(obj, meth, pm.apply_position);
55765574
exp_loc = loc; exp_extra = [];
55775575
exp_type = typ;
55785576
exp_attributes = sexp.pexp_attributes;

typing/typedtree.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ and expression_desc =
162162
for_body : expression;
163163
for_body_sort : Jkind.sort;
164164
}
165-
| Texp_send of expression * meth * apply_position * Mode.Alloc.t
165+
| Texp_send of expression * meth * apply_position
166166
| Texp_new of
167167
Path.t * Longident.t loc * Types.class_declaration * apply_position
168168
| Texp_instvar of Path.t * Path.t * string loc

typing/typedtree.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ and expression_desc =
339339
for_body : expression;
340340
for_body_sort : Jkind.sort;
341341
}
342-
| Texp_send of expression * meth * apply_position * Mode.Alloc.t
343-
(** [alloc_mode] is the allocation mode of the result *)
342+
| Texp_send of expression * meth * apply_position
344343
| Texp_new of
345344
Path.t * Longident.t loc * Types.class_declaration * apply_position
346345
| Texp_instvar of Path.t * Path.t * string loc

typing/uniqueness_analysis.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ let rec check_uniqueness_exp (ienv : Ienv.t) exp : UF.t =
12911291
let uf_to = check_uniqueness_exp ienv for_to in
12921292
let uf_body = check_uniqueness_exp ienv for_body in
12931293
UF.seq (UF.par uf_from uf_to) uf_body
1294-
| Texp_send (e, _, _, _) -> check_uniqueness_exp ienv e
1294+
| Texp_send (e, _, _) -> check_uniqueness_exp ienv e
12951295
| Texp_new _ -> UF.unused
12961296
| Texp_instvar _ -> UF.unused
12971297
| Texp_setinstvar (_, _, _, e) -> check_uniqueness_exp ienv e

typing/untypeast.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ let expression sub exp =
578578
Pexp_for (for_pat,
579579
sub.expr sub for_from, sub.expr sub for_to,
580580
for_dir, sub.expr sub for_body)
581-
| Texp_send (exp, meth, _, _) ->
581+
| Texp_send (exp, meth, _) ->
582582
Pexp_send (sub.expr sub exp, match meth with
583583
Tmeth_name name -> mkloc name loc
584584
| Tmeth_val id -> mkloc (Ident.name id) loc

0 commit comments

Comments
 (0)