From 62f6cc1dec4223532fbd15de64db4fb036932944 Mon Sep 17 00:00:00 2001 From: Roman Leshchinskiy Date: Thu, 13 Dec 2007 03:46:35 +0000 Subject: [PATCH] Don't dump simplifier iterations with -dverbose-core2core SimonPJ says this is the correct behaviour. We still have -ddump-simpl-iterations. --- compiler/coreSyn/CoreLint.lhs | 13 ++++++++++--- compiler/simplCore/SimplCore.lhs | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs index adb67ad..bd88b5f 100644 --- a/compiler/coreSyn/CoreLint.lhs +++ b/compiler/coreSyn/CoreLint.lhs @@ -17,7 +17,7 @@ A ``lint'' pass to check for Core correctness module CoreLint ( lintCoreBindings, lintUnfolding, - showPass, endPass + showPass, endPass, endIteration ) where #include "HsVersions.h" @@ -62,7 +62,14 @@ and do Core Lint when necessary. \begin{code} endPass :: DynFlags -> String -> DynFlag -> [CoreBind] -> IO [CoreBind] -endPass dflags pass_name dump_flag binds +endPass = dumpAndLint dumpIfSet_core + +endIteration :: DynFlags -> String -> DynFlag -> [CoreBind] -> IO [CoreBind] +endIteration = dumpAndLint dumpIfSet_dyn + +dumpAndLint :: (DynFlags -> DynFlag -> String -> SDoc -> IO ()) + -> DynFlags -> String -> DynFlag -> [CoreBind] -> IO [CoreBind] +dumpAndLint dump dflags pass_name dump_flag binds = do -- Report result size if required -- This has the side effect of forcing the intermediate to be evaluated @@ -70,7 +77,7 @@ endPass dflags pass_name dump_flag binds (text " Result size =" <+> int (coreBindsSize binds)) -- Report verbosely, if required - dumpIfSet_core dflags dump_flag pass_name (pprCoreBindings binds) + dump dflags dump_flag pass_name (pprCoreBindings binds) -- Type check lintCoreBindings dflags pass_name binds diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs index 86b4c66..744d54b 100644 --- a/compiler/simplCore/SimplCore.lhs +++ b/compiler/simplCore/SimplCore.lhs @@ -37,7 +37,7 @@ import Simplify ( simplTopBinds, simplExpr ) import SimplEnv ( SimplEnv, simplBinders, mkSimplEnv, setInScopeSet ) import SimplMonad import ErrUtils ( dumpIfSet, dumpIfSet_dyn, showPass ) -import CoreLint ( endPass ) +import CoreLint ( endPass, endIteration ) import FloatIn ( floatInwards ) import FloatOut ( floatOutwards ) import FamInstEnv @@ -497,7 +497,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts -- Dump the result of this iteration dumpIfSet_dyn dflags Opt_D_dump_simpl_iterations herald (pprSimplCount counts') ; - endPass dflags herald Opt_D_dump_simpl_iterations binds'' ; + endIteration dflags herald Opt_D_dump_simpl_iterations binds'' ; -- Loop do_iteration us2 (iteration_no + 1) all_counts binds'' -- 1.7.10.4