[commit: ghc] master: Improve debug tracing slighty (00cb878)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/00cb878905c1bf709dd3a3bf7be6e743ee0eb059

>---------------------------------------------------------------

commit 00cb878905c1bf709dd3a3bf7be6e743ee0eb059
Author: Simon Peyton Jones <[email protected]>
Date:   Thu Oct 4 17:51:47 2012 +0100

    Improve debug tracing slighty

>---------------------------------------------------------------

 compiler/typecheck/TcRnMonad.lhs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs
index 68301f7..c03c51b 100644
--- a/compiler/typecheck/TcRnMonad.lhs
+++ b/compiler/typecheck/TcRnMonad.lhs
@@ -627,8 +627,7 @@ discardWarnings thing_inside
 \begin{code}
 mkLongErrAt :: SrcSpan -> MsgDoc -> MsgDoc -> TcRn ErrMsg
 mkLongErrAt loc msg extra
-  = do { traceTc "Adding error:" (mkLocMessage SevError loc (msg $$ extra)) ;
-         rdr_env <- getGlobalRdrEnv ;
+  = do { rdr_env <- getGlobalRdrEnv ;
          dflags <- getDynFlags ;
          return $ mkLongErrMsg dflags loc (mkPrintUnqualified dflags rdr_env) msg extra }
 
@@ -640,13 +639,15 @@ reportErrors = mapM_ reportError
 
 reportError :: ErrMsg -> TcRn ()
 reportError err
-  = do { errs_var <- getErrsVar ;
+  = do { traceTc "Adding error:" (pprLocErrMsg err) ;
+         errs_var <- getErrsVar ;
          (warns, errs) <- readTcRef errs_var ;
          writeTcRef errs_var (warns, errs `snocBag` err) }
 
 reportWarning :: ErrMsg -> TcRn ()
 reportWarning warn
-  = do { errs_var <- getErrsVar ;
+  = do { traceTc "Adding warning:" (pprLocErrMsg warn) ;
+         errs_var <- getErrsVar ;
          (warns, errs) <- readTcRef errs_var ;
          writeTcRef errs_var (warns `snocBag` warn, errs) }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.