Skip to content

Commit e3864b7

Browse files
committed
TOP
1 parent 104b0f5 commit e3864b7

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

compiler/lib/flow.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ let rec the_shape_of info x =
402402
info
403403
(fun x ->
404404
if Var.ISet.mem info.info_possibly_mutable x
405-
then Shape.Bot "possibly_mutable"
405+
then Shape.Top "possibly_mutable"
406406
else
407407
match Shape.get x with
408408
| Some shape -> shape
@@ -411,16 +411,16 @@ let rec the_shape_of info x =
411411
| Expr (Block (_, a, _, Immutable)) ->
412412
Shape.Block (List.map ~f:(the_shape_of info) (Array.to_list a))
413413
| Expr (Closure (l, _)) ->
414-
Shape.Function { arity = List.length l; pure = false; res = Bot "unk" }
414+
Shape.Function { arity = List.length l; pure = false; res = Top "unk" }
415415
| Expr (Special (Alias_prim name)) -> (
416416
try
417417
let arity = Primitive.arity name in
418418
let pure = Primitive.is_pure name in
419-
Shape.Function { arity; pure; res = Bot "unk" }
420-
with _ -> Bot "other")
421-
| _ -> Shape.Bot "other"))
422-
(Bot "init")
423-
(fun _u _v -> Shape.Bot "merge")
419+
Shape.Function { arity; pure; res = Top "unk" }
420+
with _ -> Top "other")
421+
| _ -> Shape.Top "other"))
422+
(Top "init")
423+
(fun _u _v -> Shape.Top "merge")
424424
x
425425

426426
let build_subst (info : Info.t) vars =

compiler/lib/shape.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
open! Stdlib
2121

2222
type t =
23-
| Bot of string
23+
| Top of string
2424
| Block of t list
2525
| Function of
2626
{ arity : int
@@ -30,7 +30,7 @@ type t =
3030

3131
let rec to_string (shape : t) =
3232
match shape with
33-
| Bot s -> if true then "N" else Printf.sprintf "N(%s)" s
33+
| Top s -> if true then "N" else Printf.sprintf "N(%s)" s
3434
| Block l -> "[" ^ String.concat ~sep:"," (List.map ~f:to_string l) ^ "]"
3535
| Function { arity; _ } -> Printf.sprintf "F(%d)" arity
3636

@@ -59,7 +59,7 @@ let assign x shape = Hashtbl.add state (Var x) shape
5959
let propagate x offset target =
6060
match Hashtbl.find_opt state (Var x) with
6161
| None -> ()
62-
| Some (Bot _ | Function _) -> ()
62+
| Some (Top _ | Function _) -> ()
6363
| Some (Block l) -> Hashtbl.replace state (Var target) (List.nth l offset)
6464

6565
let get x = Hashtbl.find_opt state (Var x)

compiler/lib/shape.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*)
1919

2020
type t =
21-
| Bot of string
21+
| Top of string
2222
| Block of t list
2323
| Function of
2424
{ arity : int

compiler/lib/specialize.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let function_arity info x =
2727
| Some shape -> (
2828
match shape with
2929
| Function { arity; _ } -> Some arity
30-
| Block _ | Bot _ -> None)
30+
| Block _ | Top _ -> None)
3131
| None ->
3232
get_approx
3333
info

0 commit comments

Comments
 (0)