[commit: ghc] master: Clean up handling of known-key Names in interface files (34d933d)
git at git.haskell.org
git at git.haskell.org
Fri Oct 14 02:58:56 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/34d933d6a821edf5abfcbee76d9325362fc28a13/ghc
>---------------------------------------------------------------
commit 34d933d6a821edf5abfcbee76d9325362fc28a13
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Thu Oct 13 21:53:13 2016 -0400
Clean up handling of known-key Names in interface files
Previously BinIface had some dedicated logic for handling tuple names in
the symbol table. As it turns out, this logic was essentially dead code
as it was superceded by the special handling of known-key things. Here
we cull the tuple code-path and use the known-key codepath for all
tuple-ish things.
This had a surprising number of knock-on effects,
* constraint tuple datacons had to be made known-key (previously they
were not)
* IfaceTopBndr was changed from being a synonym of OccName to a
synonym of Name (since we now need to be able to deserialize Names
directly from interface files)
* the change to IfaceTopBndr complicated fingerprinting, since we need
to ensure that we don't go looking for the fingerprint of the thing
we are currently fingerprinting in the fingerprint environment (see
notes in MkIface). Handling this required distinguishing between
binding and non-binding Name occurrences in the Binary serializers.
* the original name cache logic which previously lived in IfaceEnv has
been moved to a new NameCache module
* I ripped tuples and sums out of knownKeyNames since they introduce a
very large number of entries. During interface file deserialization
we use static functions (defined in the new KnownUniques module) to
map from a Unique to a known-key Name (the Unique better correspond
to a known-key name!) When we need to do an original name cache
lookup we rely on the parser implemented in isBuiltInOcc_maybe.
* HscMain.allKnownKeyNames was folded into PrelInfo.knownKeyNames.
* Lots of comments were sprinkled about describing the new scheme.
Updates haddock submodule.
Test Plan: Validate
Reviewers: niteria, simonpj, austin, hvr
Reviewed By: simonpj
Subscribers: simonmar, niteria, thomie
Differential Revision: https://phabricator.haskell.org/D2467
GHC Trac Issues: #12532, #12415
>---------------------------------------------------------------
34d933d6a821edf5abfcbee76d9325362fc28a13
compiler/backpack/RnModIface.hs | 66 ++++++--
compiler/basicTypes/Name.hs | 5 +-
compiler/basicTypes/Name.hs-boot | 4 -
compiler/basicTypes/NameCache.hs | 118 ++++++++++++++
compiler/basicTypes/Unique.hs | 49 ++----
compiler/ghc.cabal.in | 3 +
compiler/ghc.mk | 3 +
compiler/iface/BinFingerprint.hs | 47 ++++++
compiler/iface/BinIface.hs | 158 +++---------------
compiler/iface/FlagChecker.hs | 4 +-
compiler/iface/IfaceEnv.hs | 157 ++++--------------
compiler/iface/IfaceSyn.hs | 181 +++++++++++++--------
compiler/iface/LoadIface.hs | 8 +-
compiler/iface/MkIface.hs | 95 ++++++-----
compiler/iface/TcIface.hs | 66 ++++----
compiler/main/HscMain.hs | 39 +----
compiler/main/HscTypes.hs | 20 +--
compiler/main/TidyPgm.hs | 1 +
compiler/prelude/KnownUniques.hs | 150 +++++++++++++++++
compiler/prelude/KnownUniques.hs-boot | 17 ++
compiler/prelude/PrelInfo.hs | 176 ++++++++++++++------
compiler/prelude/PrelNames.hs | 49 +++---
compiler/prelude/TysWiredIn.hs | 76 +++++++--
compiler/simplCore/CoreMonad.hs | 1 +
compiler/typecheck/TcRnDriver.hs | 11 +-
compiler/utils/Binary.hs | 80 +++++----
compiler/utils/Fingerprint.hsc | 15 +-
ghc/Main.hs | 3 +-
libraries/base/GHC/Fingerprint.hs | 1 -
testsuite/tests/perf/compiler/all.T | 3 +-
testsuite/tests/perf/space_leaks/all.T | 3 +-
.../tests/typecheck/should_fail/T12035j.stderr | 2 +-
utils/haddock | 2 +-
33 files changed, 963 insertions(+), 650 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 34d933d6a821edf5abfcbee76d9325362fc28a13
More information about the ghc-commits
mailing list