[commit: ghc] master: Pass DynFlags to prettyPrintGhcErrors (6515294)

Ian Lynagh igloo at earth.li
Wed Jun 13 17:15:26 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/65152943e6fe80dc5314e897dbf910137b01c47b

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

commit 65152943e6fe80dc5314e897dbf910137b01c47b
Author: Ian Lynagh <igloo at earth.li>
Date:   Mon Jun 11 17:43:46 2012 +0100

    Pass DynFlags to prettyPrintGhcErrors
    
    We don't use it yet

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

 compiler/main/ErrUtils.lhs |   21 +++++++++++----------
 ghc/Main.hs                |    2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index 7de0232..a89293f 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -334,15 +334,16 @@ debugTraceMsg :: DynFlags -> Int -> MsgDoc -> IO ()
 debugTraceMsg dflags val msg
   = ifVerbose dflags val (log_action dflags SevInfo noSrcSpan defaultDumpStyle msg)
 
-prettyPrintGhcErrors :: ExceptionMonad m => m a -> m a
-prettyPrintGhcErrors = ghandle $ \e -> case e of
-                                       PprPanic str doc ->
-                                           pprDebugAndThen panic str doc
-                                       PprSorry str doc ->
-                                           pprDebugAndThen sorry str doc
-                                       PprProgramError str doc ->
-                                           pprDebugAndThen pgmError str doc
-                                       _ ->
-                                           throw e
+prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a
+prettyPrintGhcErrors _
+    = ghandle $ \e -> case e of
+                      PprPanic str doc ->
+                          pprDebugAndThen panic str doc
+                      PprSorry str doc ->
+                          pprDebugAndThen sorry str doc
+                      PprProgramError str doc ->
+                          pprDebugAndThen pgmError str doc
+                      _ ->
+                          throw e
 \end{code}
 
diff --git a/ghc/Main.hs b/ghc/Main.hs
index ce4c628..5a51c38 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -167,7 +167,7 @@ main' postLoadMode dflags0 args flagWarnings = do
         -- Leftover ones are presumably files
   (dflags2, fileish_args, dynamicFlagWarnings) <- GHC.parseDynamicFlags dflags1a args
 
-  GHC.prettyPrintGhcErrors $ do
+  GHC.prettyPrintGhcErrors dflags2 $ do
 
   let flagWarnings' = flagWarnings ++ dynamicFlagWarnings
 





More information about the Cvs-ghc mailing list