fix(main): do not produce traces if it's not asked

This commit is contained in:
Simon Cruanes 2022-10-19 22:25:07 -04:00
parent d9b9f79b75
commit f591b6e28a
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -78,7 +78,8 @@ let argspec =
"--no-proof", Arg.Clear p_proof, " do not print proof"; "--no-proof", Arg.Clear p_proof, " do not print proof";
"-o", Arg.Set_string proof_file, " file into which to output a proof"; "-o", Arg.Set_string proof_file, " file into which to output a proof";
"--model", Arg.Set p_model, " print model"; "--model", Arg.Set p_model, " print model";
"--trace", Arg.Set enable_trace, " enable/disable tracing"; "--trace", Arg.Set enable_trace, " enable tracing";
"--no-trace", Arg.Clear enable_trace, " disable tracing";
( "--trace-file", ( "--trace-file",
Arg.Set_string trace_file, Arg.Set_string trace_file,
" store trace in given file (no cleanup)" ); " store trace in given file (no cleanup)" );
@ -136,7 +137,7 @@ let run_with_tmp_file ~enable_proof k =
CCIO.File.with_temp ~temp_dir:"." ~prefix:".sidekick-proof" ~suffix:".dat" CCIO.File.with_temp ~temp_dir:"." ~prefix:".sidekick-proof" ~suffix:".dat"
k k
else else
k "/dev/null" k ""
let mk_smt_tracer ~trace_file () = let mk_smt_tracer ~trace_file () =
if !enable_trace || trace_file <> "" then ( if !enable_trace || trace_file <> "" then (