diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-23 12:29:38 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-23 12:29:38 +0200 |
commit | 2316b5dc954b4047f3f48c61e7f4e34deb729efe (patch) | |
tree | e4818aaae7620d8df89ee5d0c407edbb77785da0 | |
parent | 69447b8515c0bd123c6aa72c5545cf9beda79ec4 (diff) | |
download | compcert-kvx-2316b5dc954b4047f3f48c61e7f4e34deb729efe.tar.gz compcert-kvx-2316b5dc954b4047f3f48c61e7f4e34deb729efe.zip |
make tracing output optional
-rw-r--r-- | backend/CSE3analysisaux.ml | 15 | ||||
-rw-r--r-- | driver/Clflags.ml | 1 | ||||
-rw-r--r-- | driver/Driver.ml | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/backend/CSE3analysisaux.ml b/backend/CSE3analysisaux.ml index e8e608da..3f7d5bb9 100644 --- a/backend/CSE3analysisaux.ml +++ b/backend/CSE3analysisaux.ml @@ -65,16 +65,18 @@ let preanalysis (tenv : typing_env) (f : RTL.coq_function) = and cur_moves = ref (PMap.init PSet.empty) in let eq_find_oracle node eq = let o = Hashtbl.find_opt eq_table (flatten_eq eq) in - Printf.printf "@%d: eq_find %a -> %a\n" (P.to_int node) - pp_eq eq (pp_option pp_P) o; + (if !Clflags.option_debug_compcert > 1 + then Printf.printf "@%d: eq_find %a -> %a\n" (P.to_int node) + pp_eq eq (pp_option pp_P) o); o and rhs_find_oracle node sop args = let o = match Hashtbl.find_opt rhs_table (sop, List.map P.to_int args) with | None -> PSet.empty | Some s -> s in - Printf.printf "@%d: rhs_find %a = %a\n" (P.to_int node) pp_rhs (sop, args) - pp_set o; + (if !Clflags.option_debug_compcert > 1 + then Printf.printf "@%d: rhs_find %a = %a\n" + (P.to_int node) pp_rhs (sop, args) pp_set o); o in let mutating_eq_find_oracle node eq : P.t option = let (flat_eq_lhs, flat_eq_op, flat_eq_args) as flat_eq = flatten_eq eq in @@ -106,8 +108,9 @@ let preanalysis (tenv : typing_env) (f : RTL.coq_function) = Some coq_id end in - Printf.printf "@%d: mutating_eq_find %a -> %a\n" (P.to_int node) - pp_eq eq (pp_option pp_P) o; + (if !Clflags.option_debug_compcert > 1 + then Printf.printf "@%d: mutating_eq_find %a -> %a\n" (P.to_int node) + pp_eq eq (pp_option pp_P) o); o in match diff --git a/driver/Clflags.ml b/driver/Clflags.ml index ff2647a7..a5f5f7a4 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -84,3 +84,4 @@ let option_fcoalesce_mem = ref true let option_fforward_moves = ref true let option_all_loads_nontrap = ref false let option_inline_auto_threshold = ref 0 +let option_debug_compcert = ref 0 diff --git a/driver/Driver.ml b/driver/Driver.ml index b167dbd1..9b873505 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -330,6 +330,7 @@ let cmdline_actions = Exact "-Os", Set option_Osize; Exact "-Obranchless", Set option_Obranchless; Exact "-finline-auto-threshold", Integer (fun n -> option_inline_auto_threshold := n); + Exact "-debug-compcert", Integer (fun n -> option_debug_compcert := n); Exact "-fsmall-data", Integer(fun n -> option_small_data := n); Exact "-fsmall-const", Integer(fun n -> option_small_const := n); Exact "-ffloat-const-prop", Integer(fun n -> option_ffloatconstprop := n); |