Commit 73f976c4 authored by Alexander Vershilov's avatar Alexander Vershilov Committed by Austin Seipp
Browse files

Make -ddump-splices output to stdout (fixes #8796)

Summary:
Fixes debug output so all info messages will use
stdout. Fixes #8796.

Make -ddump-splices output to stdout (fixes #8796)
Make -dverbose-core2core use stdout (fixes #8796)

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D627

GHC Trac Issues: #8796
parent 7cf87fc6
...@@ -135,7 +135,7 @@ traceSmpl :: String -> SDoc -> SimplM () ...@@ -135,7 +135,7 @@ traceSmpl :: String -> SDoc -> SimplM ()
traceSmpl herald doc traceSmpl herald doc
= do { dflags <- getDynFlags = do { dflags <- getDynFlags
; when (dopt Opt_D_dump_simpl_trace dflags) $ liftIO $ ; when (dopt Opt_D_dump_simpl_trace dflags) $ liftIO $
printInfoForUser dflags alwaysQualify $ printOutputForUser dflags alwaysQualify $
hang (text herald) 2 doc } hang (text herald) 2 doc }
{- {-
......
...@@ -1440,10 +1440,10 @@ completeCall env var cont ...@@ -1440,10 +1440,10 @@ completeCall env var cont
| not (dopt Opt_D_dump_inlinings dflags) = return () | not (dopt Opt_D_dump_inlinings dflags) = return ()
| not (dopt Opt_D_verbose_core2core dflags) | not (dopt Opt_D_verbose_core2core dflags)
= when (isExternalName (idName var)) $ = when (isExternalName (idName var)) $
liftIO $ printInfoForUser dflags alwaysQualify $ liftIO $ printOutputForUser dflags alwaysQualify $
sep [text "Inlining done:", nest 4 (ppr var)] sep [text "Inlining done:", nest 4 (ppr var)]
| otherwise | otherwise
= liftIO $ printInfoForUser dflags alwaysQualify $ = liftIO $ printOutputForUser dflags alwaysQualify $
sep [text "Inlining done: " <> ppr var, sep [text "Inlining done: " <> ppr var,
nest 4 (vcat [text "Inlined fn: " <+> nest 2 (ppr unfolding), nest 4 (vcat [text "Inlined fn: " <+> nest 2 (ppr unfolding),
text "Cont: " <+> ppr cont])] text "Cont: " <+> ppr cont])]
......
...@@ -551,7 +551,7 @@ printForUserTcRn :: SDoc -> TcRn () ...@@ -551,7 +551,7 @@ printForUserTcRn :: SDoc -> TcRn ()
printForUserTcRn doc printForUserTcRn doc
= do { dflags <- getDynFlags = do { dflags <- getDynFlags
; printer <- getPrintUnqualified dflags ; printer <- getPrintUnqualified dflags
; liftIO (printInfoForUser dflags printer doc) } ; liftIO (printOutputForUser dflags printer doc) }
-- | Typechecker debug -- | Typechecker debug
debugDumpTcRn :: SDoc -> TcRn () debugDumpTcRn :: SDoc -> TcRn ()
......
...@@ -105,7 +105,7 @@ initV hsc_env guts info thing_inside ...@@ -105,7 +105,7 @@ initV hsc_env guts info thing_inside
Yes genv _ x -> return $ Just (new_info genv, x) Yes genv _ x -> return $ Just (new_info genv, x)
No reason -> do { unqual <- mkPrintUnqualifiedDs No reason -> do { unqual <- mkPrintUnqualifiedDs
; liftIO $ ; liftIO $
printInfoForUser dflags unqual $ printOutputForUser dflags unqual $
mkDumpDoc "Warning: vectorisation failure:" reason mkDumpDoc "Warning: vectorisation failure:" reason
; return Nothing ; return Nothing
} }
......
...@@ -117,7 +117,7 @@ emitVt :: String -> SDoc -> VM () ...@@ -117,7 +117,7 @@ emitVt :: String -> SDoc -> VM ()
emitVt herald doc emitVt herald doc
= liftDs $ do = liftDs $ do
dflags <- getDynFlags dflags <- getDynFlags
liftIO . printInfoForUser dflags alwaysQualify $ liftIO . printOutputForUser dflags alwaysQualify $
hang (text herald) 2 doc hang (text herald) 2 doc
-- |Output a trace message if -ddump-vt-trace is active. -- |Output a trace message if -ddump-vt-trace is active.
...@@ -144,7 +144,7 @@ dumpVt :: String -> SDoc -> VM () ...@@ -144,7 +144,7 @@ dumpVt :: String -> SDoc -> VM ()
dumpVt header doc dumpVt header doc
= do { unqual <- liftDs mkPrintUnqualifiedDs = do { unqual <- liftDs mkPrintUnqualifiedDs
; dflags <- liftDs getDynFlags ; dflags <- liftDs getDynFlags
; liftIO $ printInfoForUser dflags unqual (mkDumpDoc header doc) ; liftIO $ printOutputForUser dflags unqual (mkDumpDoc header doc)
} }
......
Markdown is supported
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