[commit: ghc] master: Refactor temp files cleanup (3ee3822)

git at git.haskell.org git at git.haskell.org
Thu Jun 8 19:36:38 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/3ee3822ce588565e912ab6211e9d2cd545fc6ba6/ghc

>---------------------------------------------------------------

commit 3ee3822ce588565e912ab6211e9d2cd545fc6ba6
Author: Douglas Wilson <douglas.wilson at gmail.com>
Date:   Thu Jun 8 14:59:49 2017 -0400

    Refactor temp files cleanup
    
    Remove filesToNotIntermediateClean from DynFlags, create a data type
    FilesToClean, and change filesToClean in DynFlags to be a FilesToClean.
    
    Modify SysTools.newTempName and the Temporary constructor of
    PipelineMonad.PipelineOutput to take a TempFileLifetime, which specifies
    whether a temp file should live until the end of GhcMonad.withSession,
    or until the next time cleanIntermediateTempFiles is called.
    
    These changes allow the cleaning of intermediate files in GhcMake to be
    much more efficient.
    
    HscTypes.hptObjs is removed as it is no longer used.
    
    A new performance test T13701 is added, which passes both with and
    without -keep-tmp-files.  The test fails by 25% without the patch, and
    passes when -keep-tmp-files is added.
    
    Note that there are still at two hotspots caused by
    algorithms quadratic in the number of modules, however neither of them
    allocate. They are:
    
    * DriverPipeline.compileOne'.needsLinker
    * GhcMake.getModLoop
    
    DriverPipeline.compileOne'.needsLinker is changed slightly to improve
    the situation.
    
    I don't like adding these Types to DynFlags, but they need to be seen by
    Dynflags, SysTools and PipelineMonad. The alternative seems to be to
    create a new module.
    
    Reviewers: austin, hvr, bgamari, dfeuer, niteria, simonmar, erikd
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13701
    
    Differential Revision: https://phabricator.haskell.org/D3620


>---------------------------------------------------------------

3ee3822ce588565e912ab6211e9d2cd545fc6ba6
 compiler/ghc.cabal.in                   |   1 +
 compiler/ghc.mk                         |   1 +
 compiler/ghci/Linker.hs                 |   8 +-
 compiler/iface/MkIface.hs               |   4 +-
 compiler/main/CodeOutput.hs             |   6 +-
 compiler/main/DriverMkDepend.hs         |   5 +-
 compiler/main/DriverPipeline.hs         |  70 +++++----
 compiler/main/DynFlags.hs               |  32 +++-
 compiler/main/ErrUtils.hs               |  21 +++
 compiler/main/FileCleanup.hs            | 249 ++++++++++++++++++++++++++++++++
 compiler/main/GHC.hs                    |   3 +-
 compiler/main/GhcMake.hs                |  81 +++++------
 compiler/main/HscTypes.hs               |   3 -
 compiler/main/PipelineMonad.hs          |   3 +-
 compiler/main/SysTools.hs               | 218 +---------------------------
 ghc/GHCi/UI.hs                          |   2 +-
 testsuite/tests/perf/compiler/all.T     |  11 ++
 testsuite/tests/perf/compiler/genT13701 |  14 ++
 18 files changed, 427 insertions(+), 305 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3ee3822ce588565e912ab6211e9d2cd545fc6ba6


More information about the ghc-commits mailing list