Skip to content

Commit

Permalink
Improve Useless.Value.layout
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed May 15, 2024
1 parent 322205f commit 741732b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mlton/ssa/useless.fun
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,25 @@ structure Value =
end
and layoutValue value =
case value of
Array {elt, length, ...} =>
seq [str "array", tuple [layout length, layoutSlot elt]]
Array {elt, length, useful} =>
seq [str "array ",
record [("useful", Useful.layout useful),
("length", layout length),
("elt", layoutSlot elt)]]
| Ground g => seq [str "ground ", Useful.layout g]
| Ref {arg, useful, ...} =>
seq [str "ref ",
record [("useful", Useful.layout useful),
("slot", layoutSlot arg)]]
("arg", layoutSlot arg)]]
| Tuple vs => Vector.layout layoutSlot vs
| Vector {elt, length} =>
seq [str "vector", tuple [layout length, layoutSlot elt]]
seq [str "vector ",
record [("length", layout length),
("elt", layoutSlot elt)]]
| Weak {arg, useful} =>
seq [str "weak ",
record [("useful", Useful.layout useful),
("slot", layoutSlot arg)]]
("arg", layoutSlot arg)]]
and layoutSlot (v, e) =
tuple [Exists.layout e, layout v]
end
Expand Down

0 comments on commit 741732b

Please sign in to comment.