summaryrefslogtreecommitdiff
path: root/src/Translate.ml
diff options
context:
space:
mode:
authorSon Ho2022-02-04 12:28:58 +0100
committerSon Ho2022-02-04 12:28:58 +0100
commit25200ad9664980d3276dd7462b4845a1a21c3e64 (patch)
tree650cf79925acaeceba0d845df42c54dc51366673 /src/Translate.ml
parent6ae85370a6d385e6824753f08ac593d22d6fc958 (diff)
Make the micro passes config a parameter of Translate.translate_module
Diffstat (limited to '')
-rw-r--r--src/Translate.ml19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Translate.ml b/src/Translate.ml
index e79a47c4..30d6d0f8 100644
--- a/src/Translate.ml
+++ b/src/Translate.ml
@@ -203,7 +203,8 @@ let translate_function_to_pure (config : C.partial_config)
(* Return *)
(pure_forward, pure_backwards)
-let translate_module_to_pure (config : C.partial_config) (m : M.cfim_module) :
+let translate_module_to_pure (config : C.partial_config)
+ (mp_config : Micro.config) (m : M.cfim_module) :
trans_ctx * Pure.type_def list * pure_fun_translation list =
(* Debug *)
log#ldebug (lazy "translate_module_to_pure");
@@ -243,16 +244,9 @@ let translate_module_to_pure (config : C.partial_config) (m : M.cfim_module) :
in
(* Apply the micro-passes *)
- (* TODO: move the configuration *)
- let passes_config =
- {
- Micro.unfold_monadic_let_bindings = true;
- filter_unused_monadic_calls = true;
- }
- in
let pure_translations =
List.map
- (Micro.apply_passes_to_pure_fun_translation passes_config trans_ctx)
+ (Micro.apply_passes_to_pure_fun_translation mp_config trans_ctx)
pure_translations
in
@@ -269,9 +263,12 @@ let translate_module_to_pure (config : C.partial_config) (m : M.cfim_module) :
```
*)
let translate_module (filename : string) (config : C.partial_config)
- (test_unit_functions : bool) (m : M.cfim_module) : unit =
+ (mp_config : Micro.config) (test_unit_functions : bool) (m : M.cfim_module)
+ : unit =
(* Translate the module to the pure AST *)
- let trans_ctx, trans_types, trans_funs = translate_module_to_pure config m in
+ let trans_ctx, trans_types, trans_funs =
+ translate_module_to_pure config mp_config m
+ in
(* Initialize the extraction context - for now we extract only to F* *)
let names_map =