From 40e64b305dbcb0db2b93958c3aeb3cc12a17d0c3 Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Wed, 6 Jul 2011 09:52:46 +0200 Subject: [PATCH] Tomato: disable debug messages by default --- compiler/minils/transformations/tomato.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/minils/transformations/tomato.ml b/compiler/minils/transformations/tomato.ml index d43f81b..5704fb6 100644 --- a/compiler/minils/transformations/tomato.ml +++ b/compiler/minils/transformations/tomato.ml @@ -20,6 +20,10 @@ open Clocks open Pp_tools open Mls_compare +let debug = false + +let debug_do f () = if debug then f () else () + (* Data-flow minimization on MiniLS: @@ -501,12 +505,12 @@ let compute_new_class (tenv : tom_env) = let rec separate_classes tenv = let rec fix (id, tenv) = let new_id, tenv = compute_new_class tenv in - Format.printf "New tenv %d:\n%a@." id debug_tenv tenv; + debug_do (fun () -> Format.printf "New tenv %d:\n%a@." id debug_tenv tenv) (); if new_id = id then tenv else fix (new_id, tenv) in - Format.printf "Initial tenv:\n%a@." debug_tenv tenv; + debug_do (fun () -> Format.printf "Initial tenv:\n%a@." debug_tenv tenv) (); let id, tenv = compute_new_class tenv in - Format.printf "New tenv %d:\n%a@." id debug_tenv tenv; + debug_do (fun () -> Format.printf "New tenv %d:\n%a@." id debug_tenv tenv) (); fix (id, tenv) (********************************************************************)