Skip to content

Commit

Permalink
Remove reference to Debug. replace it by verbose.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpouzet committed Nov 1, 2024
1 parent 8e2beb1 commit faed0ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/compiler/rewrite/dependences.ml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ let make eqs =
name_to_index (Env.empty, Env.empty, []) eqs in
let g = make_read_write xtable itable eq_info_list in
let g = make_unsafes xtable itable g eqs in
if !Misc.debug then Format.eprintf "@[%a@.@]" dump eq_info_list;
if !Misc.vverbose then Format.eprintf "@[%a@.@]" dump eq_info_list;
Graph.outputs g

(* Print a graph of equations *)
Expand Down
17 changes: 8 additions & 9 deletions src/compiler/rewrite/rewrite.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,20 @@ let set_steps w =
let rewrite_list () =
List.filter (fun (w, _, _) -> S.mem w !s_set) default_list

let compare name n_steps genv0 p p' =
Debug.print_message
("Checks the pass " ^ name ^
" for " ^ (string_of_int n_steps) ^" steps\n");
let genv = Coiteration.program genv0 p in
let genv' = Coiteration.program genv0 p' in
Coiteration.check n_steps genv genv'; p'

(* Apply a sequence of source-to-source transformation *)
(* do equivalence checking for every step if [n_steps <> 0] *)
let main print_message genv0 p n_steps =
let compare name n_steps genv0 p p' =
print_message ("Checks the pass " ^ name ^
" for " ^ (string_of_int n_steps) ^" steps\n");
let genv = Coiteration.program genv0 p in
let genv' = Coiteration.program genv0 p' in
Coiteration.check n_steps genv genv'; p' in

let rewrite_and_compare genv p (name, comment, rewrite) =
let p' = rewrite genv p in
print_message comment;
Debug.print_program p';
if !Misc.verbose then Printer.program Format.err_formatter p';
if n_steps = 0 then p' else compare name n_steps genv p p' in

let iter genv p l = List.fold_left (rewrite_and_compare genv) p l in
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/rewrite/static.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ let no_leq loc =
let rename_t ({ e_renaming } as acc) x =
try Env.find x e_renaming, acc
with Not_found ->
Debug.print_string "Static: unbound identifier" (Ident.name x);
raise Error (* x, acc *)
Format.eprintf "Error during static reduction; unbound identifier %s"
(Ident.name x);
raise Error

let write_t acc { dv; di; der } =
let rename acc x = let x, _ = rename_t acc x in x in
Expand Down

0 comments on commit faed0ec

Please sign in to comment.