[GHC] #12532: Remove sum and tuple names from knownKeyNames

GHC ghc-devs at haskell.org
Fri Oct 14 02:58:48 UTC 2016


#12532: Remove sum and tuple names from knownKeyNames
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  task              |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2467
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"34d933d6a821edf5abfcbee76d9325362fc28a13/ghc" 34d933d/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="34d933d6a821edf5abfcbee76d9325362fc28a13"
 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
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12532#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list