diff --git a/src/compiler/rewrite/dependences.ml b/src/compiler/rewrite/dependences.ml index 99a18e13..2691dff2 100644 --- a/src/compiler/rewrite/dependences.ml +++ b/src/compiler/rewrite/dependences.ml @@ -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 *) diff --git a/src/compiler/rewrite/rewrite.ml b/src/compiler/rewrite/rewrite.ml index 1e8eb53d..b96109e1 100644 --- a/src/compiler/rewrite/rewrite.ml +++ b/src/compiler/rewrite/rewrite.ml @@ -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 diff --git a/src/compiler/rewrite/static.ml b/src/compiler/rewrite/static.ml index ce3836d9..e8ba276b 100644 --- a/src/compiler/rewrite/static.ml +++ b/src/compiler/rewrite/static.ml @@ -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