summaryrefslogtreecommitdiff
path: root/compiler/Pure.ml
diff options
context:
space:
mode:
authorSon Ho2023-01-07 16:47:33 +0100
committerSon HO2023-02-03 11:21:46 +0100
commitf8b7206e0d92aa33812047c521a3c2278fdb6327 (patch)
tree2f7a37aa85200f5757d0c9fa9d9bd46ae6c6fcff /compiler/Pure.ml
parent9a94302823e07c4e8a50ea4e67c8f61e8827c23c (diff)
Improve the heuristic to find pretty names for the variables in the loops
Diffstat (limited to '')
-rw-r--r--compiler/Pure.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/Pure.ml b/compiler/Pure.ml
index 118aec50..fe30a650 100644
--- a/compiler/Pure.ml
+++ b/compiler/Pure.ml
@@ -358,7 +358,7 @@ type qualif_id =
*)
type qualif = { id : qualif_id; type_args : ty list } [@@deriving show]
-type var_id = VarId.id [@@deriving show]
+type var_id = VarId.id [@@deriving show, ord]
(** Ancestor for {!iter_expression} visitor *)
class ['self] iter_expression_base =
@@ -513,14 +513,21 @@ and texpression = { e : expression; ty : ty }
*)
and mvalue = (texpression[@opaque])
+(** Meta-information stored in the AST *)
and meta =
| Assignment of mplace * mvalue * mplace option
- (** Meta-information stored in the AST.
+ (** Information about an assignment which occured in LLBC.
+ We use this to guide the heuristics which derive pretty names.
The first mplace stores the destination.
The mvalue stores the value which is put in the destination
The second (optional) mplace stores the origin.
*)
+ | SymbolicAssignment of (var_id[@opaque]) * mvalue
+ (** Informationg linking a variable (from the pure AST) to an
+ expression.
+ We use this to guide the heuristics which derive pretty names.
+ *)
| MPlace of mplace (** Meta-information about the origin of a value *)
| Tag of string (** A tag - typically used for debugging *)
[@@deriving