aboutsummaryrefslogtreecommitdiff
path: root/pretyping/cbv.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-10-13 21:19:34 +0200
committerEmilio Jesus Gallego Arias2018-11-28 02:00:53 +0100
commitdf85d9b765940b58a189b91cfdc67be7e0fd75e3 (patch)
tree297517301041274f5546b5f62f7181c3cf70f2fc /pretyping/cbv.ml
parentec7aec452da1ad0bf53145a314df7c00194218a6 (diff)
[options] New helper for creation of boolean options plus reference.
This makes setting the option outside of the synchronized summary impossible.
Diffstat (limited to 'pretyping/cbv.ml')
-rw-r--r--pretyping/cbv.ml19
1 files changed, 8 insertions, 11 deletions
diff --git a/pretyping/cbv.ml b/pretyping/cbv.ml
index 7104b8586e..f8289f558c 100644
--- a/pretyping/cbv.ml
+++ b/pretyping/cbv.ml
@@ -183,14 +183,11 @@ let cofixp_reducible flgs _ stk =
else
false
-let debug_cbv = ref false
-let () = Goptions.(declare_bool_option {
- optdepr = false;
- optname = "cbv visited constants display";
- optkey = ["Debug";"Cbv"];
- optread = (fun () -> !debug_cbv);
- optwrite = (fun a -> debug_cbv:=a);
-})
+let get_debug_cbv = Goptions.declare_bool_option_and_ref
+ ~depr:false
+ ~value:false
+ ~name:"cbv visited constants display"
+ ~key:["Debug";"Cbv"]
let debug_pr_key = function
| ConstKey (sp,_) -> Names.Constant.print sp
@@ -325,14 +322,14 @@ and norm_head_ref k info env stack normt =
if red_set_ref info.reds normt then
match cbv_value_cache info normt with
| Some body ->
- if !debug_cbv then Feedback.msg_debug Pp.(str "Unfolding " ++ debug_pr_key normt);
+ if get_debug_cbv () then Feedback.msg_debug Pp.(str "Unfolding " ++ debug_pr_key normt);
strip_appl (shift_value k body) stack
| None ->
- if !debug_cbv then Feedback.msg_debug Pp.(str "Not unfolding " ++ debug_pr_key normt);
+ if get_debug_cbv () then Feedback.msg_debug Pp.(str "Not unfolding " ++ debug_pr_key normt);
(VAL(0,make_constr_ref k normt),stack)
else
begin
- if !debug_cbv then Feedback.msg_debug Pp.(str "Not unfolding " ++ debug_pr_key normt);
+ if get_debug_cbv () then Feedback.msg_debug Pp.(str "Not unfolding " ++ debug_pr_key normt);
(VAL(0,make_constr_ref k normt),stack)
end