Skip to content

Commit 2b421a9

Browse files
authored
flambda-backend: Add more accessors to Shape to make it compatible with ocaml-uideps (#2209)
1 parent d1f82c4 commit 2b421a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

typing/shape.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ let app ?uid f ~arg =
306306
let comp_unit ?uid s =
307307
{ uid; desc = Comp_unit s; hash = Hashtbl.hash (hash_comp_unit, uid, s) }
308308

309+
let no_fuel_left ?uid s = { s with uid }
310+
309311
let decompose_abs t =
310312
match t.desc with
311313
| Abs (x, t) -> Some (x, t)
@@ -591,7 +593,7 @@ end) = struct
591593
proj ?uid t item
592594
| NLeaf -> leaf' uid
593595
| NComp_unit s -> comp_unit ?uid s
594-
| NoFuelLeft t -> { t with uid }
596+
| NoFuelLeft t -> no_fuel_left ?uid t
595597

596598
let reduce global_env t =
597599
let fuel = ref Params.fuel in

typing/shape.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ val app : ?uid:Uid.t -> t -> arg:t -> t
8888
val str : ?uid:Uid.t -> t Item.Map.t -> t
8989
val proj : ?uid:Uid.t -> t -> Item.t -> t
9090
val leaf : Uid.t -> t
91+
val leaf' : Uid.t option -> t
92+
val no_fuel_left : ?uid:Uid.t -> t -> t
93+
val comp_unit : ?uid:Uid.t -> string -> t
9194

9295
val decompose_abs : t -> (var * t) option
9396

0 commit comments

Comments
 (0)