New flag: -ddump-simpl-phases
[ghc-hetmet.git] / compiler / simplCore / SimplCore.lhs
index ded393f..e2ac668 100644 (file)
@@ -4,11 +4,11 @@
 \section[SimplCore]{Driver for simplifying @Core@ programs}
 
 \begin{code}
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
---     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
 module SimplCore ( core2core, simplifyExpr ) where
@@ -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
@@ -407,7 +407,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts
                         text "",
                         pprSimplCount counts_out]);
 
-       endPass dflags ("Simplify phase " ++ phase_info ++ " done") Opt_D_verbose_core2core binds';
+       endPass dflags ("Simplify phase " ++ phase_info ++ " done") Opt_D_dump_simpl_phases binds';
 
        return (counts_out, guts { mg_binds = binds' })
     }
@@ -429,7 +429,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts
            if  max_iterations > 2 then
                hPutStr stderr ("NOTE: Simplifier still going after " ++ 
                                show max_iterations ++ 
-                               " iterations; bailing out.\n")
+                               " iterations; bailing out.  Size = " ++ show (coreBindsSize binds) ++ "\n" )
            else 
                return ();
 #endif
@@ -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''