diff options
author | Son Ho | 2022-01-18 22:43:52 +0100 |
---|---|---|
committer | Son Ho | 2022-01-18 22:43:52 +0100 |
commit | 280c5b1a7fde56d1d0238b44555de486fc1f563e (patch) | |
tree | 7418c9ea9fb1d06bc6dc5a0547c770032719a3ab /src/Interpreter.ml | |
parent | 90d47b033118c923591f7a64d63a98709ce7aa4b (diff) |
Update type_context to have to have a type info field, use maps instead
of lists to store the types/functions definitions
Diffstat (limited to 'src/Interpreter.ml')
-rw-r--r-- | src/Interpreter.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Interpreter.ml b/src/Interpreter.ml index 3c467fbe..ec1e6373 100644 --- a/src/Interpreter.ml +++ b/src/Interpreter.ml @@ -23,14 +23,19 @@ let log = L.interpreter_log module Test = struct let initialize_context (m : M.cfim_module) (type_vars : T.type_var list) : C.eval_ctx = + let type_decls, _ = M.split_declarations m.declarations in + let type_defs, fun_defs = M.compute_defs_maps m in let type_defs_groups, _funs_defs_groups = M.split_declarations_to_group_maps m.declarations in - let type_context = { C.type_defs_groups; type_defs = m.types } in + let type_infos = + TypesAnalysis.analyze_type_declarations type_defs type_decls + in + let type_context = { C.type_defs_groups; type_defs; type_infos } in C.reset_global_counters (); { C.type_context; - C.fun_context = m.functions; + C.fun_context = fun_defs; C.type_vars; C.env = []; C.ended_regions = T.RegionId.Set.empty; |