diff options
Diffstat (limited to '')
-rw-r--r-- | src/PureMicroPasses.ml | 18 | ||||
-rw-r--r-- | src/Translate.ml | 2 | ||||
-rw-r--r-- | src/main.ml | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/PureMicroPasses.ml b/src/PureMicroPasses.ml index 7094d885..dba6b5e8 100644 --- a/src/PureMicroPasses.ml +++ b/src/PureMicroPasses.ml @@ -41,7 +41,7 @@ type config = { [decompose_monadic_let_bindings] to true and only makes the code more verbose. *) - filter_unused_monadic_calls : bool; + filter_useless_monadic_calls : bool; (** Controls whether we try to filter the calls to monadic functions (which can fail) when their outputs are not used. @@ -51,7 +51,7 @@ type config = { TODO: rename to [filter_useless_monadic_calls] *) filter_useless_functions : bool; - (** If [filter_unused_monadic_calls] is activated, some functions + (** If [filter_useless_monadic_calls] is activated, some functions become useless: if this option is true, we don't extract them. The calls to functions which always get filtered are: @@ -514,11 +514,11 @@ let expression_contains_child_call_in_all_paths (ctx : trans_ctx) (call0 : call) in visitor#visit_texpression () e () -(** Filter the unused assignments (removes the unused variables, filters +(** Filter the useless assignments (removes the useless variables, filters the function calls) *) -let filter_unused (filter_monadic_calls : bool) (ctx : trans_ctx) +let filter_useless (filter_monadic_calls : bool) (ctx : trans_ctx) (def : fun_def) : fun_def = - (* We first need a transformation on *left-values*, which filters the unused + (* We first need a transformation on *left-values*, which filters the useless * variables and tells us whether the value contains any variable which has * not been replaced by `_` (in which case we need to keep the assignment, * etc.). @@ -557,7 +557,7 @@ let filter_unused (filter_monadic_calls : bool) (ctx : trans_ctx) (* We then implement the transformation on *expressions* through a mapreduce. * Note that the transformation is bottom-up. - * The map filters the unused assignments, the reduce computes the set of + * The map filters the useless assignments, the reduce computes the set of * used variables. *) let expr_visitor = @@ -934,10 +934,10 @@ let apply_passes_to_def (config : config) (ctx : trans_ctx) (def : fun_def) : (lazy ("eliminate_box_functions:\n\n" ^ fun_def_to_string ctx def ^ "\n")); - (* Filter the unused variables, assignments, function calls, etc. *) - let def = filter_unused config.filter_unused_monadic_calls ctx def in + (* Filter the useless variables, assignments, function calls, etc. *) + let def = filter_useless config.filter_useless_monadic_calls ctx def in log#ldebug - (lazy ("filter_unused:\n\n" ^ fun_def_to_string ctx def ^ "\n")); + (lazy ("filter_useless:\n\n" ^ fun_def_to_string ctx def ^ "\n")); (* Decompose the monadic let-bindings *) let def = diff --git a/src/Translate.ml b/src/Translate.ml index d51ec826..8084dc38 100644 --- a/src/Translate.ml +++ b/src/Translate.ml @@ -138,7 +138,7 @@ let translate_function_to_pure (config : C.partial_config) let sp_config = { SymbolicToPure.filter_useless_back_calls = - mp_config.filter_unused_monadic_calls; + mp_config.filter_useless_monadic_calls; } in diff --git a/src/main.ml b/src/main.ml index 17ab6421..19f05a4c 100644 --- a/src/main.ml +++ b/src/main.ml @@ -26,7 +26,7 @@ let () = let dest_dir = ref "" in let decompose_monads = ref false in let unfold_monads = ref true in - let filter_unused_calls = ref true in + let filter_useless_calls = ref true in let filter_useless_functions = ref true in let test_units = ref false in let test_trans_units = ref false in @@ -48,9 +48,9 @@ let () = ( "-unfold-monads", Arg.Set unfold_monads, " Unfold the monadic let-bindings to matches" ); - ( "-filter-unused-calls", - Arg.Set filter_unused_calls, - " Filter the unused function calls, when possible" ); + ( "-filter-useless-calls", + Arg.Set filter_useless_calls, + " Filter the useless function calls, when possible" ); ( "-filter-useless-funs", Arg.Set filter_useless_functions, " Filter the useless forward/backward functions" ); @@ -145,7 +145,7 @@ let () = { Micro.decompose_monadic_let_bindings = !decompose_monads; unfold_monadic_let_bindings = !unfold_monads; - filter_unused_monadic_calls = !filter_unused_calls; + filter_useless_monadic_calls = !filter_useless_calls; filter_useless_functions = !filter_useless_functions; add_unit_args = false; } |