[commit: ghc] master: Report term sizes with -v3 even when -ddump is enabled (c2bbc8b)
git at git.haskell.org
git at git.haskell.org
Wed Jun 8 10:59:17 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c2bbc8baf6947e00689b556e6e30e1ec39d2e68a/ghc
>---------------------------------------------------------------
commit c2bbc8baf6947e00689b556e6e30e1ec39d2e68a
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Wed Jun 8 07:02:29 2016 -0400
Report term sizes with -v3 even when -ddump is enabled
This is the proper fix for the problem I tried solve with D2310
(committed as dd33245 and reverted in 44a3c18).
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2315
>---------------------------------------------------------------
c2bbc8baf6947e00689b556e6e30e1ec39d2e68a
compiler/coreSyn/CoreLint.hs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 0261f7e..9c5b033 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -211,13 +211,14 @@ dumpPassResult :: DynFlags
-> CoreProgram -> [CoreRule]
-> IO ()
dumpPassResult dflags unqual mb_flag hdr extra_info binds rules
- | Just flag <- mb_flag
- = Err.dumpSDoc dflags unqual flag (showSDoc dflags hdr) dump_doc
+ = do { forM_ mb_flag $ \flag ->
+ Err.dumpSDoc dflags unqual flag (showSDoc dflags hdr) dump_doc
- | otherwise
- = Err.debugTraceMsg dflags 2 size_doc
- -- Report result size
- -- This has the side effect of forcing the intermediate to be evaluated
+ -- Report result size
+ -- This has the side effect of forcing the intermediate to be evaluated
+ -- if it's not already forced by a -ddump flag.
+ ; Err.debugTraceMsg dflags 2 size_doc
+ }
where
size_doc = sep [text "Result size of" <+> hdr, nest 2 (equals <+> ppr (coreBindsStats binds))]
More information about the ghc-commits
mailing list