diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-03-23 16:11:45 +0100 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-10-28 14:11:18 -0700 |
commit | fb40d415b947805ac33690f63317dd3b8c3e85d6 (patch) | |
tree | 45e231bc7f1ac87c28801016247907a8056252b8 /compiler/main/CodeOutput.hs | |
parent | f4e783e6cdcb83592643ad3f726f5d607f78e1e1 (diff) | |
download | haskell-wip/ghc-7.10-with-timings.tar.gz |
ErrUtils: Add timings to compiler phaseswip/ghc-7.10-with-timings
This adds timings and allocation figures to the compiler's output when
run with `-v2` in an effort to ease performance analysis.
Todo:
* Documentation
* Where else should we add these?
* Perhaps we should remove some of the now-arguably-redundant
`showPass` occurrences where they are
* Must we force more?
* Perhaps we should place this behind a `-ftimings` instead of `-v2`
Test Plan: `ghc -v2 Test.hs`, look at the output
Reviewers: hvr, goldfire, simonmar, austin
Reviewed By: simonmar
Subscribers: angerman, michalt, niteria, ezyang, thomie
Differential Revision: https://phabricator.haskell.org/D1959
(cherry picked from commit 8048d51be0676627b417c128af0b0c352b75c537)
Diffstat (limited to 'compiler/main/CodeOutput.hs')
-rw-r--r-- | compiler/main/CodeOutput.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs index f55a15a842..2e10b23a9d 100644 --- a/compiler/main/CodeOutput.hs +++ b/compiler/main/CodeOutput.hs @@ -64,9 +64,10 @@ codeOutput dflags this_mod filenm location foreign_stubs pkg_deps cmm_stream then Stream.mapM do_lint cmm_stream else cmm_stream - do_lint cmm = do - { showPass dflags "CmmLint" - ; case cmmLint dflags cmm of + do_lint cmm = withTiming (pure dflags) + (text "CmmLint"<+>brackets (ppr this_mod)) + (const ()) $ do + { case cmmLint dflags cmm of Just err -> do { log_action dflags dflags SevDump noSrcSpan defaultDumpStyle err ; ghcExit dflags 1 } |