[commit: ghc] master: Compile modules that are needed by template haskell, even with -fno-code. (53c78be)

git at git.haskell.org git at git.haskell.org
Sat May 20 20:29:38 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/53c78be0aab76a3107c4dacbb1d177afacdd37fa/ghc

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

commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa
Author: Douglas Wilson <douglas.wilson at gmail.com>
Date:   Sat May 20 12:47:41 2017 -0400

    Compile modules that are needed by template haskell, even with -fno-code.
    
    This patch relates to Trac #8025
    
    The goal here is to enable typechecking of packages that contain some
    template haskell. Prior to this patch, compilation of a package with
    -fno-code would fail if any functions in the package were called from
    within a splice.
    
    downsweep is changed to do an additional pass over the modules,
    targetting any ModSummaries transitively depended on by a module that
    has LangExt.TemplateHaskell enabled. Those targeted modules have
    hscTarget changed from HscNothing to the default target of the platform.
    
    There is a small change to the prevailing_target logic to enable this.
    
    A simple test is added.
    
    I have benchmarked with and without a patched haddock
    (available:https://github.com/duog/haddock/tree/wip-no-explicit-th-compi
    lation).  Running cabal haddock on the wreq package results in a 25%
    speedup on my machine:
    
    time output from patched cabal haddock:
    
    real    0m5.780s
    user    0m5.304s
    sys     0m0.496s
    time output from unpatched cabal haddock:
    
    real    0m7.712s
    user    0m6.888s
    sys     0m0.736s
    
    Reviewers: austin, bgamari, ezyang
    
    Reviewed By: bgamari
    
    Subscribers: bgamari, DanielG, rwbarton, thomie
    
    GHC Trac Issues: #8025
    
    Differential Revision: https://phabricator.haskell.org/D3441


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

53c78be0aab76a3107c4dacbb1d177afacdd37fa
 compiler/backpack/DriverBkp.hs                     |   1 +
 compiler/main/DriverPipeline.hs                    |  73 +++++----
 compiler/main/DynFlags.hs                          |  10 +-
 compiler/main/GhcMake.hs                           | 182 +++++++++++++++++++--
 compiler/main/HscTypes.hs                          |   2 +-
 .../Sub1.hs => th/should_compile/T8025/A.hs}       |   4 +-
 testsuite/tests/th/should_compile/T8025/B.hs       |   5 +
 .../T12062 => th/should_compile/T8025}/Makefile    |   0
 testsuite/tests/th/should_compile/T8025/all.T      |   2 +
 9 files changed, 220 insertions(+), 59 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 53c78be0aab76a3107c4dacbb1d177afacdd37fa


More information about the ghc-commits mailing list