[commit: ghc] master: Axe initIfaceTc, tie the knot through HPT (or if_rec_types). (e907e1f)

git at git.haskell.org git at git.haskell.org
Sun Aug 21 09:46:24 UTC 2016


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

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

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

commit e907e1f12f4dedc0ec13c7a501c8810bcfc03583
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sun Jun 19 14:28:55 2016 -0700

    Axe initIfaceTc, tie the knot through HPT (or if_rec_types).
    
    Summary:
    initIfaceTc was originally used to make sure when we typecheck
    an interface, it can find the TyThings for things it itself
    defined.  However, in the case of retypecheckLoop, this wasn't
    necessary because we ALREADY tied the knot through the HPT.
    
    This commit removes initIfaceTc, instead relying on the HPT
    to tie the knot.  genModDetails' caller needed to be modified
    to tie the knot, but there are not that many call-sites of
    typecheckIface so the change is quite reasonable.
    
    We also introduce a new 'initIfaceLoad', which does
    NOT set up 'if_rec_types'.  It's used when we're
    typechecking old, up-to-date interfaces in, since we're
    never going to update the type environment.
    
    The full details are in Note [Knot-tying typecheckIface].
    Displeasingly, we need a special case to handle DFuns in
    the case of tcHiBootIface, see
    Note [DFun knot-tying special case] for the gory details.
    
    I also added another test which tickles a bug in a buggy
    version of this patch (see "Why the seq?")
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: simonpj, austin, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2349


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

e907e1f12f4dedc0ec13c7a501c8810bcfc03583
 compiler/iface/TcIface.hs                          | 68 ++++++++++++++------
 compiler/main/HscMain.hs                           | 34 +++++++---
 compiler/main/HscTypes.hs                          | 45 +++++++++++++-
 compiler/typecheck/TcRnDriver.hs                   | 72 ++++++++++++++++++----
 compiler/typecheck/TcRnMonad.hs                    | 32 ++++------
 compiler/typecheck/TcRnTypes.hs                    |  1 +
 testsuite/driver/extra_files.py                    |  1 +
 testsuite/tests/typecheck/should_compile/Makefile  |  6 ++
 testsuite/tests/typecheck/should_compile/Tc266.hs  |  4 ++
 .../tests/typecheck/should_compile/Tc266.hs-boot   |  3 +
 testsuite/tests/typecheck/should_compile/Tc266a.hs |  2 +
 testsuite/tests/typecheck/should_compile/all.T     |  4 ++
 12 files changed, 214 insertions(+), 58 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 e907e1f12f4dedc0ec13c7a501c8810bcfc03583


More information about the ghc-commits mailing list