diff options
-rw-r--r-- | compiler/main/DynFlags.hs | 2 | ||||
-rw-r--r-- | compiler/stranal/DmdAnal.lhs | 12 | ||||
-rw-r--r-- | docs/users_guide/debugging.xml | 10 | ||||
-rw-r--r-- | docs/users_guide/flags.xml | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 05a72d63bb..70d2a81b13 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -242,6 +242,7 @@ data DumpFlag | Opt_D_dump_prep | Opt_D_dump_stg | Opt_D_dump_stranal + | Opt_D_dump_strsigs | Opt_D_dump_tc | Opt_D_dump_types | Opt_D_dump_rules @@ -2311,6 +2312,7 @@ dynamic_flags = [ , Flag "ddump-prep" (setDumpFlag Opt_D_dump_prep) , Flag "ddump-stg" (setDumpFlag Opt_D_dump_stg) , Flag "ddump-stranal" (setDumpFlag Opt_D_dump_stranal) + , Flag "ddump-strsigs" (setDumpFlag Opt_D_dump_strsigs) , Flag "ddump-tc" (setDumpFlag Opt_D_dump_tc) , Flag "ddump-types" (setDumpFlag Opt_D_dump_types) , Flag "ddump-rules" (setDumpFlag Opt_D_dump_rules) diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs index 99eb7ac5ba..0ceb7c95c5 100644 --- a/compiler/stranal/DmdAnal.lhs +++ b/compiler/stranal/DmdAnal.lhs @@ -35,6 +35,7 @@ import Util import Maybes ( isJust, orElse ) import TysWiredIn ( unboxedPairDataCon ) import TysPrim ( realWorldStatePrimTy ) +import ErrUtils ( dumpIfSet_dyn ) \end{code} %************************************************************************ @@ -48,6 +49,8 @@ dmdAnalProgram :: DynFlags -> CoreProgram -> IO CoreProgram dmdAnalProgram dflags binds = do { let { binds_plus_dmds = do_prog binds } ; + dumpIfSet_dyn dflags Opt_D_dump_strsigs "Strictness signatures" $ + dumpStrSig binds_plus_dmds ; return binds_plus_dmds } where @@ -1100,6 +1103,15 @@ set_idDemandInfo env id dmd set_idStrictness :: AnalEnv -> Id -> StrictSig -> Id set_idStrictness env id sig = setIdStrictness id (zapStrictSig (ae_dflags env) sig) + +dumpStrSig :: CoreProgram -> SDoc +dumpStrSig binds = vcat (concatMap goBind binds) + where + goBind (NonRec i _) = [ goId i ] + goBind (Rec bs) = map (goId . fst) bs + goId id | isExportedId id = ppr id <> colon <+> pprIfaceStrictSig (idStrictness id) + | otherwise = empty + \end{code} Note [Initial CPR for strict binders] diff --git a/docs/users_guide/debugging.xml b/docs/users_guide/debugging.xml index 003d2b5cd4..513034599a 100644 --- a/docs/users_guide/debugging.xml +++ b/docs/users_guide/debugging.xml @@ -202,6 +202,16 @@ <varlistentry> <term> + <option>-ddump-strsigs</option>: + <indexterm><primary><option>-ddump-strsigs</option></primary></indexterm> + </term> + <listitem> + <para>strictness signatures</para> + </listitem> + </varlistentry> + + <varlistentry> + <term> <option>-ddump-cse</option>: <indexterm><primary><option>-ddump-cse</option></primary></indexterm> </term> diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 72ef91ed82..2422b9d36d 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -2817,6 +2817,12 @@ <entry>-</entry> </row> <row> + <entry><option>-ddump-strsigs</option></entry> + <entry>Dump strictness signatures</entry> + <entry>dynamic</entry> + <entry>-</entry> + </row> + <row> <entry><option>-ddump-tc</option></entry> <entry>Dump typechecker output</entry> <entry>dynamic</entry> |