summaryrefslogtreecommitdiff
path: root/src/Pure.ml
diff options
context:
space:
mode:
authorSon Ho2022-01-27 18:46:05 +0100
committerSon Ho2022-01-27 18:46:05 +0100
commit88f5aa47d97b212fe9cc6187b818493d30a9db98 (patch)
treef78ae018b4c9f7f5d2c7787774e3dfa2c47e9558 /src/Pure.ml
parentea254c8af48ad5b4efd56624de40a9cb42452dd2 (diff)
Add a "basename" field in Pure.var
Diffstat (limited to 'src/Pure.ml')
-rw-r--r--src/Pure.ml15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Pure.ml b/src/Pure.ml
index 45609273..02f6b1ba 100644
--- a/src/Pure.ml
+++ b/src/Pure.ml
@@ -82,17 +82,20 @@ type scalar_value = V.scalar_value
type constant_value = V.constant_value
-type var = { id : VarId.id; ty : ty }
+type var = {
+ id : VarId.id;
+ basename : string option;
+ (** The "basename" is used to generate a meaningful name for the variable
+ (by potentially adding an index to uniquely identify it).
+ *)
+ ty : ty;
+}
(** Because we introduce a lot of temporary variables, the list of variables
is not fixed: we thus must carry all its information with the variable
itself.
-
- TODO: add a field for the basename.
*)
-type var_or_dummy =
- | Var of var (** TODO: use var_id, not var *)
- | Dummy (** Ignored value: `_`. *)
+type var_or_dummy = Var of var | Dummy (** Ignored value: `_`. *)
(** A left value (which appears on the left of assignments *)
type lvalue =