summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorChaitanya Koparkar <ckoparkar@gmail.com>2018-11-29 18:45:07 -0500
committerRyan Scott <ryan.gl.scott@gmail.com>2018-11-29 18:45:19 -0500
commitdcf1f9268f6b338997f2c03891d7bc57da2ee78a (patch)
treeaf97fdc33de5ab91e187636377bf296cff45b095 /compiler/deSugar
parent9e3aaf8b58d0f0e12e2d19b6928b6c2461d58dda (diff)
downloadhaskell-dcf1f9268f6b338997f2c03891d7bc57da2ee78a.tar.gz
Fix #15953 by consistently using dumpIfSet_dyn to print debug output
Summary: In some modules we directly dump the debugging output to STDOUT via 'putLogMsg', 'printInfoForUser' etc. However, if `-ddump-to-file` is enabled, that output should be written to a file. Easily fixed. Certain tests (T3017, Roles3, T12763 etc.) expect part of the output generated by `-ddump-types` to be in 'PprUser' style. However, generally we want all other debugging output to use 'PprDump' style. `traceTcRn` and `traceTcRnForUser` help us accomplish this. This patch also documents some missing flags in the users guide. Reviewers: RyanGlScott, bgamari, hvr Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15953 Differential Revision: https://phabricator.haskell.org/D5382
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/Coverage.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs
index 1dbacfc47f..bea0172a69 100644
--- a/compiler/deSugar/Coverage.hs
+++ b/compiler/deSugar/Coverage.hs
@@ -93,7 +93,7 @@ addTicksToBinds hsc_env mod mod_loc exports tyCons binds
, density = mkDensity tickish dflags
, this_mod = mod
, tickishType = tickish
-}
+ }
(binds',_,st') = unTM (addTickLHsBinds binds) env st
in (binds', st')
@@ -109,9 +109,7 @@ addTicksToBinds hsc_env mod mod_loc exports tyCons binds
hashNo <- writeMixEntries dflags mod tickCount entries orig_file2
modBreaks <- mkModBreaks hsc_env mod tickCount entries
- when (dopt Opt_D_dump_ticked dflags) $
- putLogMsg dflags NoReason SevDump noSrcSpan
- (defaultDumpStyle dflags) (pprLHsBinds binds1)
+ dumpIfSet_dyn dflags Opt_D_dump_ticked "HPC" (pprLHsBinds binds1)
return (binds1, HpcInfo tickCount hashNo, Just modBreaks)