[commit: ghc] master: Rework the Implicit CallStack solver to handle local lets. (3ec8288)

git at git.haskell.org git at git.haskell.org
Sat Dec 12 17:38:58 UTC 2015


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

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

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

commit 3ec8288a18d57fb856e257905897daae237a1d5d
Author: Eric Seidel <gridaphobe at gmail.com>
Date:   Sat Dec 12 16:53:50 2015 +0100

    Rework the Implicit CallStack solver to handle local lets.
    
    We can't just solve CallStack constraints indiscriminately when they
    occur in the RHS of a let-binder. The top-level given CallStack (if
    any) will not be in scope, so I've re-worked the CallStack solver as
    follows:
    
    1. CallStacks are treated like regular IPs unless one of the following
       two rules apply.
    
    2. In a function call, we push the call-site onto a NEW wanted
       CallStack, which GHC will solve as a regular IP (either directly from a
       given, or by quantifying over it in a local let).
    
    3. If, after the constraint solver is done, any wanted CallStacks
       remain, we default them to the empty CallStack. This rule exists mainly
       to clean up after rule 2 in a top-level binder with no given CallStack.
    
    In rule (2) we have to be careful to emit the new wanted with an
    IPOccOrigin instead of an OccurrenceOf origin, so rule (2) doesn't fire
    again. This is a bit shady but I've updated the Note to explain the
    trick.
    
    Test Plan: validate
    
    Reviewers: simonpj, austin, bgamari, hvr
    
    Reviewed By: simonpj, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1422
    
    GHC Trac Issues: #10845


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

3ec8288a18d57fb856e257905897daae237a1d5d
 .gitignore                                         |   1 +
 compiler/deSugar/DsBinds.hs                        |   3 +-
 compiler/typecheck/TcEvidence.hs                   | 119 ++++++++++-----------
 compiler/typecheck/TcHsSyn.hs                      |   2 -
 compiler/typecheck/TcInteract.hs                   |  77 +++++++------
 compiler/typecheck/TcRnTypes.hs                    |  17 ++-
 compiler/typecheck/TcSimplify.hs                   |  38 ++++++-
 compiler/utils/Outputable.hs                       |   5 +-
 docs/users_guide/7.12.1-notes.rst                  |  46 ++++----
 docs/users_guide/glasgow_exts.rst                  |  63 +++++------
 libraries/base/GHC/Exception.hs                    |  40 ++++---
 libraries/base/GHC/IO/Exception.hs                 |   2 +-
 libraries/base/GHC/Stack.hs                        |   6 +-
 libraries/base/GHC/Stack/Types.hs                  |  59 +++++++---
 libraries/base/changelog.md                        |  12 ++-
 testsuite/.gitignore                               |   1 +
 testsuite/tests/codeGen/should_run/cgrun059.stderr |   1 +
 .../tests/concurrent/should_run/conc021.stderr     |   1 +
 .../tests/ghci.debugger/scripts/break011.stdout    |   8 +-
 .../tests/ghci.debugger/scripts/break017.stdout    |   3 +-
 .../tests/ghci.debugger/scripts/print033.stdout    |   2 +-
 testsuite/tests/ghci/scripts/T5557.stdout          |   6 +-
 testsuite/tests/ghci/scripts/T8959.stdout          |   9 +-
 testsuite/tests/ghci/scripts/ghci013.stdout        |   2 +-
 testsuite/tests/ghci/scripts/ghci046.stdout        |   4 +-
 testsuite/tests/ghci/scripts/ghci055.stdout        |   7 +-
 .../should_compile/ExtraConstraints3.stderr        |   4 +-
 .../tests/partial-sigs/should_fail/T10999.stderr   |   7 +-
 .../tests/pmcheck/should_compile/T3927b.stderr     |  39 -------
 testsuite/tests/th/T1849.script                    |   6 +-
 testsuite/tests/typecheck/should_run/IPLocation.hs |  26 ++---
 .../tests/typecheck/should_run/IPLocation.stdout   |  36 +++----
 testsuite/tests/typecheck/should_run/T10845.hs     |  20 ++++
 testsuite/tests/typecheck/should_run/T10845.stdout |   5 +
 testsuite/tests/typecheck/should_run/T10846.hs     |  20 ++++
 testsuite/tests/typecheck/should_run/T10846.stdout |   3 +
 testsuite/tests/typecheck/should_run/T8119.stdout  |   3 +-
 testsuite/tests/typecheck/should_run/all.T         |   2 +
 38 files changed, 396 insertions(+), 309 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 3ec8288a18d57fb856e257905897daae237a1d5d


More information about the ghc-commits mailing list