Skip to content
Snippets Groups Projects
Commit 52f5e8fb authored by cydparser's avatar cydparser Committed by Marge Bot
Browse files

Fix -ddump-to-file and -ddump-timings interaction (#20316)

parent d7047e0d
No related branches found
No related tags found
No related merge requests found
......@@ -414,7 +414,7 @@ withTiming' :: MonadIO m
-> m a
withTiming' logger what force_result prtimings action
= if logVerbAtLeast logger 2 || logHasDumpFlag logger Opt_D_dump_timings
then do whenPrintTimings $
then do when printTimingsNotDumpToFile $ liftIO $
logInfo logger $ withPprStyle defaultUserStyle $
text "***" <+> what <> colon
let ctx = log_default_user_context (logFlags logger)
......@@ -432,7 +432,7 @@ withTiming' logger what force_result prtimings action
let alloc = alloc0 - alloc1
time = realToFrac (end - start) * 1e-9
when (logVerbAtLeast logger 2 && prtimings == PrintTimings)
when (logVerbAtLeast logger 2 && printTimingsNotDumpToFile)
$ liftIO $ logInfo logger $ withPprStyle defaultUserStyle
(text "!!!" <+> what <> colon <+> text "finished in"
<+> doublePrec 2 time
......@@ -452,7 +452,16 @@ withTiming' logger what force_result prtimings action
pure r
else action
where whenPrintTimings = liftIO . when (prtimings == PrintTimings)
where whenPrintTimings =
liftIO . when printTimings
printTimings =
prtimings == PrintTimings
-- Avoid both printing to console and dumping to a file (#20316).
printTimingsNotDumpToFile =
printTimings
&& not (log_dump_to_file (logFlags logger))
recordAllocs alloc =
liftIO $ traceMarkerIO $ "GHC:allocs:" ++ show alloc
......
*** initializing unit database:
*** Chasing dependencies:
*** Parser [Main]:
*** Renamer/typechecker [Main]:
*** Desugar [Main]:
*** CoreTidy [Main]:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment