[commit: ghc] master: Clean up interaction between name cache and built-in syntax (9513fe6)

git at git.haskell.org git at git.haskell.org
Wed Jul 20 15:16:25 UTC 2016


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

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

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

commit 9513fe6bdeafd35ca1a04e17b5f94732516766aa
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Wed Jul 20 12:34:54 2016 +0200

    Clean up interaction between name cache and built-in syntax
    
    This cleans up various aspects of the handling of built-in syntax in the
    original name cache (hopefully resulting in a nice reduction in compiler
    allocations),
    
      * Remove tuple types from original name cache: There is really no
        reason for these to be in the name cache since we already handle
        them specially in interface files to ensure that we can resolve them
        directly to Names, avoiding extraneous name cache lookups.
    
      * Sadly it's not possible to remove all traces of tuples from the
        name cache, however. Namely we need to keep the tuple type
        representations in since otherwise they would need to be wired-in
    
      * Remove the special cases for (:), [], and (##) in isBuiltInOcc_maybe
        and rename it to isTupleOcc_maybe
    
      * Split lookupOrigNameCache into two variants,
    
         * lookupOrigNameCache': Merely looks up an OccName in the original
           name cache, making no attempt to resolve tuples
    
         * lookupOrigNameCache: Like the above but handles tuples as well.
           This is given the un-primed name since it does the "obvious"
           thing from the perspective of an API user, who knows nothing of
           our special treatment of tuples.
    
    Arriving at this design took a significant amount of iteration. The
    trail of debris leading here can be found in #11357.
    
    Thanks to ezyang and Simon for all of their help in coming to this
    solution.
    
    Test Plan: Validate
    
    Reviewers: goldfire, simonpj, austin
    
    Reviewed By: simonpj
    
    Subscribers: thomie, ezyang
    
    Differential Revision: https://phabricator.haskell.org/D2414
    
    GHC Trac Issues: #11357


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

9513fe6bdeafd35ca1a04e17b5f94732516766aa
 compiler/iface/BinIface.hs       |  5 ++-
 compiler/iface/IfaceEnv.hs       | 40 +++++++++++++++-------
 compiler/prelude/PrelInfo.hs     | 14 +++++++-
 compiler/prelude/PrelNames.hs    |  3 +-
 compiler/prelude/TysWiredIn.hs   | 74 +++++++++++++++++++++++-----------------
 compiler/typecheck/TcTypeable.hs | 19 +++++++++++
 6 files changed, 109 insertions(+), 46 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 9513fe6bdeafd35ca1a04e17b5f94732516766aa


More information about the ghc-commits mailing list