summaryrefslogtreecommitdiff
path: root/compiler/Interpreter.ml
diff options
context:
space:
mode:
authorSon Ho2023-08-18 10:27:55 +0200
committerSon Ho2023-08-18 10:27:55 +0200
commit26c25bf375742cf4d5a0ab160b9646e90c067f18 (patch)
tree2b9363b5fe9fca6d1bdf154ea5fb4f21bc706e2a /compiler/Interpreter.ml
parent316c386bcdbb66accdd65a311ca978b6d4606695 (diff)
Update following the introduction of ConstantExpr
Diffstat (limited to '')
-rw-r--r--compiler/Interpreter.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/Interpreter.ml b/compiler/Interpreter.ml
index 154c5a21..37eeb333 100644
--- a/compiler/Interpreter.ml
+++ b/compiler/Interpreter.ml
@@ -34,6 +34,15 @@ let initialize_eval_context (type_context : C.type_context)
(region_groups : T.RegionGroupId.id list) (type_vars : T.type_var list)
(const_generic_vars : T.const_generic_var list) : C.eval_ctx =
C.reset_global_counters ();
+ let const_generic_vars_map =
+ T.ConstGenericVarId.Map.of_list
+ (List.map
+ (fun (cg : T.const_generic_var) ->
+ let ty = TypesUtils.ety_no_regions_to_rty (T.Literal cg.ty) in
+ let cv = mk_fresh_symbolic_typed_value V.ConstGeneric ty in
+ (cg.index, cv))
+ const_generic_vars)
+ in
{
C.type_context;
C.fun_context;
@@ -41,6 +50,7 @@ let initialize_eval_context (type_context : C.type_context)
C.region_groups;
C.type_vars;
C.const_generic_vars;
+ C.const_generic_vars_map;
C.env = [ C.Frame ];
C.ended_regions = T.RegionId.Set.empty;
}