Don't dump simplifier iterations with -dverbose-core2core
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Thu, 13 Dec 2007 03:46:35 +0000 (03:46 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Thu, 13 Dec 2007 03:46:35 +0000 (03:46 +0000)
SimonPJ says this is the correct behaviour. We still have
-ddump-simpl-iterations.

compiler/coreSyn/CoreLint.lhs
compiler/simplCore/SimplCore.lhs

index adb67ad..bd88b5f 100644 (file)
@@ -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
index 86b4c66..744d54b 100644 (file)
@@ -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''