summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-11 17:43:46 +0100
committerIan Lynagh <igloo@earth.li>2012-06-11 17:43:46 +0100
commit65152943e6fe80dc5314e897dbf910137b01c47b (patch)
tree5f68d960e94ef95e1caad7f0b67f03368a93446d
parent2de63e5a912f2abbda44a8125f374b19e8c3a0ff (diff)
downloadhaskell-65152943e6fe80dc5314e897dbf910137b01c47b.tar.gz
Pass DynFlags to prettyPrintGhcErrors
We don't use it yet
-rw-r--r--compiler/main/ErrUtils.lhs21
-rw-r--r--ghc/Main.hs2
2 files changed, 12 insertions, 11 deletions
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index 7de0232e96..a89293fb61 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 ce4c62822f..5a51c38d92 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