[commit: ghc] ghc-8.0: Improve debug printing/warnings (00b64a5)
git at git.haskell.org
git at git.haskell.org
Mon Jan 18 13:05:45 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/00b64a5dbbce2076df8900dae4e0bc9bd66f1506/ghc
>---------------------------------------------------------------
commit 00b64a5dbbce2076df8900dae4e0bc9bd66f1506
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Jan 11 09:02:25 2016 +0000
Improve debug printing/warnings
(cherry picked from commit 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e)
>---------------------------------------------------------------
00b64a5dbbce2076df8900dae4e0bc9bd66f1506
compiler/typecheck/TcRnTypes.hs | 4 +++-
compiler/typecheck/TcSMonad.hs | 5 ++++-
compiler/typecheck/TcSimplify.hs | 3 ++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs
index 401aa85..6bb3e16 100644
--- a/compiler/typecheck/TcRnTypes.hs
+++ b/compiler/typecheck/TcRnTypes.hs
@@ -1773,7 +1773,9 @@ instance Outputable Ct where
CTyEqCan {} -> text "CTyEqCan"
CFunEqCan {} -> text "CFunEqCan"
CNonCanonical {} -> text "CNonCanonical"
- CDictCan {} -> text "CDictCan"
+ CDictCan { cc_pend_sc = pend_sc }
+ | pend_sc -> text "CDictCan(psc)"
+ | otherwise -> text "CDictCan"
CIrredEvCan {} -> text "CIrredEvCan"
CHoleCan { cc_occ = occ } -> text "CHoleCan:" <+> ppr occ
diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs
index 073def1..9777ce9 100644
--- a/compiler/typecheck/TcSMonad.hs
+++ b/compiler/typecheck/TcSMonad.hs
@@ -13,7 +13,8 @@ module TcSMonad (
updWorkListTcS,
-- The TcS monad
- TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, failTcS,
+ TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds,
+ failTcS, warnTcS,
runTcSEqualities,
nestTcS, nestImplicTcS,
@@ -2318,7 +2319,9 @@ wrapWarnTcS :: TcM a -> TcS a
wrapWarnTcS = wrapTcS
failTcS, panicTcS :: SDoc -> TcS a
+warnTcS :: SDoc -> TcS ()
failTcS = wrapTcS . TcM.failWith
+warnTcS = wrapTcS . TcM.addWarn
panicTcS doc = pprPanic "TcCanonical" doc
traceTcS :: String -> SDoc -> TcS ()
diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 8d49410..33ee1da 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -1033,7 +1033,7 @@ simpl_loop n limit floated_eqs no_new_scs
= return wc -- Done!
| n `intGtLimit` limit
- = failTcS (hang (ptext (sLit "solveWanteds: too many iterations")
+ = do { warnTcS (hang (ptext (sLit "solveWanteds: too many iterations")
<+> parens (ptext (sLit "limit =") <+> ppr limit))
2 (vcat [ ptext (sLit "Unsolved:") <+> ppr wc
, ppUnless (isEmptyBag floated_eqs) $
@@ -1042,6 +1042,7 @@ simpl_loop n limit floated_eqs no_new_scs
ptext (sLit "New superclasses found")
, ptext (sLit "Set limit with -fconstraint-solver-iterations=n; n=0 for no limit")
]))
+ ; return wc }
| otherwise
= do { traceTcS "simpl_loop, iteration" (int n)
More information about the ghc-commits
mailing list