Commit 65152943 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Pass DynFlags to prettyPrintGhcErrors

We don't use it yet
parent 2de63e5a
......@@ -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}
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment