diff options
| author | Chaitanya Koparkar <ckoparkar@gmail.com> | 2018-11-29 18:45:07 -0500 |
|---|---|---|
| committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-11-29 18:45:19 -0500 |
| commit | dcf1f9268f6b338997f2c03891d7bc57da2ee78a (patch) | |
| tree | af97fdc33de5ab91e187636377bf296cff45b095 /compiler/main/Packages.hs | |
| parent | 9e3aaf8b58d0f0e12e2d19b6928b6c2461d58dda (diff) | |
| download | haskell-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/main/Packages.hs')
| -rw-r--r-- | compiler/main/Packages.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 2ee2136581..70c9c26c11 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -82,7 +82,7 @@ import Maybes import System.Environment ( getEnv ) import FastString -import ErrUtils ( debugTraceMsg, MsgDoc, printInfoForUser ) +import ErrUtils ( debugTraceMsg, MsgDoc, dumpIfSet_dyn ) import Exception import System.Directory @@ -1583,9 +1583,8 @@ mkPackageState dflags dbs preload0 = do mod_map2 = mkUnusableModuleToPkgConfAll unusable mod_map = Map.union mod_map1 mod_map2 - when (dopt Opt_D_dump_mod_map dflags) $ - printInfoForUser (dflags { pprCols = 200 }) - alwaysQualify (pprModuleMap mod_map) + dumpIfSet_dyn (dflags { pprCols = 200 }) Opt_D_dump_mod_map "Mod Map" + (pprModuleMap mod_map) -- Force pstate to avoid leaking the dflags0 passed to mkPackageState let !pstate = PackageState{ |
