diff options
Diffstat (limited to 'compiler/specialise/SpecConstr.hs')
-rw-r--r-- | compiler/specialise/SpecConstr.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index 5ee2dec594..f6e10adad4 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -41,8 +41,7 @@ import VarEnv import VarSet import Name import BasicTypes -import DynFlags ( DynFlags(..) ) -import StaticFlags ( opt_PprStyle_Debug ) +import DynFlags ( DynFlags(..), hasPprDebug ) import Maybes ( orElse, catMaybes, isJust, isNothing ) import Demand import GHC.Serialized ( deserializeWithData ) @@ -1522,8 +1521,10 @@ specialise env bind_calls (RI { ri_fn = fn, ri_lam_bndrs = arg_bndrs spec_count' = n_pats + spec_count ; case sc_count env of Just max | not (sc_force env) && spec_count' > max - -> if (debugIsOn || opt_PprStyle_Debug) -- Suppress this scary message for - then pprTrace "SpecConstr" msg $ -- ordinary users! Trac #5125 + -- Suppress this scary message for + -- ordinary users! Trac #5125 + -> if (debugIsOn || hasPprDebug (sc_dflags env)) + then pprTrace "SpecConstr" msg $ return (nullUsage, spec_info) else return (nullUsage, spec_info) where @@ -1533,8 +1534,10 @@ specialise env bind_calls (RI { ri_fn = fn, ri_lam_bndrs = arg_bndrs text "but the limit is" <+> int max) ] , text "Use -fspec-constr-count=n to set the bound" , extra ] - extra | not opt_PprStyle_Debug = text "Use -dppr-debug to see specialisations" - | otherwise = text "Specialisations:" <+> ppr (pats ++ [p | OS p _ _ _ <- specs]) + extra = sdocWithPprDebug $ \dbg -> if dbg + then text "Specialisations:" + <+> ppr (pats ++ [p | OS p _ _ _ <- specs]) + else text "Use -dppr-debug to see specialisations" _normal_case -> do { |