summaryrefslogtreecommitdiff
path: root/compiler/Pure.ml
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/Pure.ml')
-rw-r--r--compiler/Pure.ml22
1 files changed, 13 insertions, 9 deletions
diff --git a/compiler/Pure.ml b/compiler/Pure.ml
index 77265f75..ae4cba22 100644
--- a/compiler/Pure.ml
+++ b/compiler/Pure.ml
@@ -1,6 +1,7 @@
open Identifiers
open Names
module T = Types
+module PV = PrimitiveValues
module V = Values
module E = Expressions
module A = LlbcAst
@@ -122,7 +123,7 @@ type type_decl = {
[@@deriving show]
type scalar_value = V.scalar_value [@@deriving show]
-type constant_value = V.constant_value [@@deriving show]
+type primitive_value = V.primitive_value [@@deriving show]
(** 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
@@ -167,7 +168,10 @@ type variant_id = VariantId.id [@@deriving show]
class ['self] iter_value_base =
object (_self : 'self)
inherit [_] VisitorsRuntime.iter
- method visit_constant_value : 'env -> constant_value -> unit = fun _ _ -> ()
+
+ method visit_primitive_value : 'env -> primitive_value -> unit =
+ fun _ _ -> ()
+
method visit_var : 'env -> var -> unit = fun _ _ -> ()
method visit_mplace : 'env -> mplace -> unit = fun _ _ -> ()
method visit_ty : 'env -> ty -> unit = fun _ _ -> ()
@@ -179,7 +183,7 @@ class ['self] map_value_base =
object (_self : 'self)
inherit [_] VisitorsRuntime.map
- method visit_constant_value : 'env -> constant_value -> constant_value =
+ method visit_primitive_value : 'env -> primitive_value -> primitive_value =
fun _ x -> x
method visit_var : 'env -> var -> var = fun _ x -> x
@@ -193,7 +197,7 @@ class virtual ['self] reduce_value_base =
object (self : 'self)
inherit [_] VisitorsRuntime.reduce
- method visit_constant_value : 'env -> constant_value -> 'a =
+ method visit_primitive_value : 'env -> primitive_value -> 'a =
fun _ _ -> self#zero
method visit_var : 'env -> var -> 'a = fun _ _ -> self#zero
@@ -207,8 +211,8 @@ class virtual ['self] mapreduce_value_base =
object (self : 'self)
inherit [_] VisitorsRuntime.mapreduce
- method visit_constant_value : 'env -> constant_value -> constant_value * 'a
- =
+ method visit_primitive_value
+ : 'env -> primitive_value -> primitive_value * 'a =
fun _ x -> (x, self#zero)
method visit_var : 'env -> var -> var * 'a = fun _ x -> (x, self#zero)
@@ -224,8 +228,8 @@ class virtual ['self] mapreduce_value_base =
(** A pattern (which appears on the left of assignments, in matches, etc.). *)
type pattern =
- | PatConcrete of constant_value
- (** {!PatConcrete} is necessary because we merge the switches over integer
+ | PatConstant of primitive_value
+ (** {!PatConstant} is necessary because we merge the switches over integer
values and the matches over enumerations *)
| PatVar of var * mplace option
| PatDummy (** Ignored value: [_]. *)
@@ -373,7 +377,7 @@ class virtual ['self] mapreduce_expression_base =
*)
type expression =
| Var of var_id (** a variable *)
- | Const of constant_value
+ | Const of primitive_value
| App of texpression * texpression
(** Application of a function to an argument.