diff options
author | simonpj@microsoft.com <unknown> | 2008-09-15 15:49:08 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2008-09-15 15:49:08 +0000 |
commit | af37b3001b086f39cbf1fe3ea2aa5c37f4f9a34f (patch) | |
tree | 51bbe86bb7b60fa7eed64ae47a2b5bb237f2d667 /compiler/specialise | |
parent | db9c51c958c211ddd5056b5a31be0d72f40bde97 (diff) | |
download | haskell-af37b3001b086f39cbf1fe3ea2aa5c37f4f9a34f.tar.gz |
Improve warning for SpecConstr
Diffstat (limited to 'compiler/specialise')
-rw-r--r-- | compiler/specialise/SpecConstr.lhs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs index 7eb3529d4e..bdd9a16a71 100644 --- a/compiler/specialise/SpecConstr.lhs +++ b/compiler/specialise/SpecConstr.lhs @@ -36,6 +36,7 @@ import Name import OccName ( mkSpecOcc ) import ErrUtils ( dumpIfSet_dyn ) import DynFlags ( DynFlags(..), DynFlag(..) ) +import StaticFlags ( opt_PprStyle_Debug ) import StaticFlags ( opt_SpecInlineJoinPoints ) import BasicTypes ( Activation(..) ) import Maybes ( orElse, catMaybes, isJust, isNothing ) @@ -1021,10 +1022,14 @@ specialise env bind_calls (fn, arg_bndrs, body, arg_occs) ; let spec_count' = length pats + spec_count ; case sc_count env of Just max | spec_count' > max - -> pprTrace "SpecConstr: too many specialisations for one function (see -fspec-constr-count):" - (vcat [ptext (sLit "Function:") <+> ppr fn, - ptext (sLit "Specialisations:") <+> ppr (pats ++ [p | OS p _ _ _ <- specs])]) - return (nullUsage, spec_info) + -> WARN( True, msg ) return (nullUsage, spec_info) + where + msg = vcat [ sep [ ptext (sLit "SpecConstr: specialisation of") <+> quotes (ppr fn) + , nest 2 (ptext (sLit "limited by bound of")) <+> int max ] + , ptext (sLit "Use -fspec-constr-count=n to set the bound") + , extra ] + extra | not opt_PprStyle_Debug = ptext (sLit "Use -dppr-debug to see specialisations") + | otherwise = ptext (sLit "Specialisations:") <+> ppr (pats ++ [p | OS p _ _ _ <- specs]) _normal_case -> do { |