Wolfgang Jeltsch pushed to branch wip/jeltsch/smaller-pit at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Unit/Module/ModIface.hs
    ... ... @@ -78,6 +78,7 @@ module GHC.Unit.Module.ModIface
    78 78
        , IfaceCache_ (..)
    
    79 79
        , IfaceSimplifiedCore (..)
    
    80 80
        , withSelfRecomp
    
    81
    +   , IfaceHashData
    
    81 82
        , IfaceSelfRecompData
    
    82 83
        , IfaceSimplifiedCoreData
    
    83 84
        , ExtensibleFieldsData
    
    ... ... @@ -252,6 +253,11 @@ type family IfaceBinHandle (phase :: ModIfacePhase) where
    252 253
       IfaceBinHandle 'ModIfaceFinal    = FullBinData
    
    253 254
       IfaceBinHandle 'ModIfaceRetained = Void
    
    254 255
     
    
    256
    +type family IfaceHashData (phase :: ModIfacePhase) where
    
    257
    +  IfaceHashData 'ModIfaceCore     = ()
    
    258
    +  IfaceHashData 'ModIfaceFinal    = Fingerprint
    
    259
    +  IfaceHashData 'ModIfaceRetained = ()
    
    260
    +
    
    255 261
     type family IfaceSelfRecompData (phase :: ModIfacePhase) where
    
    256 262
       IfaceSelfRecompData 'ModIfaceCore     = Maybe IfaceSelfRecomp
    
    257 263
       IfaceSelfRecompData 'ModIfaceFinal    = Maybe IfaceSelfRecomp
    
    ... ... @@ -364,7 +370,7 @@ data ModIface_ (phase :: ModIfacePhase)
    364 370
                     --   when taking partially defined values into account, because
    
    365 371
                     --   @Strict.Just undefined@ is @undefined@ and so @Nothing@ and
    
    366 372
                     --   @undefined@ are the only inhabitants of that type.
    
    367
    -        mi_iface_hash_  :: Fingerprint, -- A hash of the whole interface
    
    373
    +        mi_iface_hash_  :: IfaceHashData phase, -- A hash of the whole interface
    
    368 374
     
    
    369 375
             mi_mod_info_     :: IfaceModInfo,
    
    370 376
                     -- ^ Meta information about the module the interface file is for
    
    ... ... @@ -870,7 +876,7 @@ emptyPartialModIface mod
    870 876
       = PrivateModIface
    
    871 877
         {
    
    872 878
           mi_hi_bytes_        = Strict.Nothing,
    
    873
    -      mi_iface_hash_      = fingerprint0,
    
    879
    +      mi_iface_hash_      = (),
    
    874 880
           mi_mod_info_        = emptyIfaceModInfo mod,
    
    875 881
           mi_deps_            = noDependencies,
    
    876 882
           mi_public_          = emptyPartialIfacePublic,
    
    ... ... @@ -927,8 +933,9 @@ emptyModIface mod
    927 933
       | PrivateModIface {..} <- emptyPartialModIface mod
    
    928 934
       = PrivateModIface
    
    929 935
         {
    
    930
    -      mi_hi_bytes_ = Strict.Nothing,
    
    931
    -      mi_public_   = convertIfacePublic mi_public_,
    
    936
    +      mi_hi_bytes_   = Strict.Nothing,
    
    937
    +      mi_iface_hash_ = fingerprint0,
    
    938
    +      mi_public_     = convertIfacePublic mi_public_,
    
    932 939
           ..
    
    933 940
         }
    
    934 941
       where
    
    ... ... @@ -987,7 +994,8 @@ emptyIfaceHashCache _occ = Nothing
    987 994
     
    
    988 995
     -- ModIface is completely forced since it will live in memory for a long time.
    
    989 996
     -- If forcing it uses a lot of memory, then store less things in ModIface.
    
    990
    -instance ( NFData (IfaceSelfRecompData phase)
    
    997
    +instance ( NFData (IfaceHashData phase)
    
    998
    +         , NFData (IfaceSelfRecompData phase)
    
    991 999
              , NFData (IfaceSimplifiedCoreData phase)
    
    992 1000
              , NFData (ExtensibleFieldsData phase)
    
    993 1001
              , NFData (IfaceAnnotationsData phase)
    
    ... ... @@ -1133,6 +1141,7 @@ retainedModIface PrivateModIface {..}
    1133 1141
       = PrivateModIface
    
    1134 1142
         {
    
    1135 1143
           mi_hi_bytes_        = Strict.Nothing,
    
    1144
    +      mi_iface_hash_      = (),
    
    1136 1145
           mi_public_          = retainedIfacePublic mi_public_,
    
    1137 1146
           mi_self_recomp_     = (),
    
    1138 1147
           mi_simplified_core_ = (),
    
    ... ... @@ -1371,7 +1380,7 @@ pattern ModIface ::
    1371 1380
       -> Module
    
    1372 1381
       -> Maybe Module
    
    1373 1382
       -> HscSource
    
    1374
    -  -> Fingerprint
    
    1383
    +  -> IfaceHashData phase
    
    1375 1384
       -> Dependencies
    
    1376 1385
       -> IfacePublic_ phase
    
    1377 1386
       -> [IfaceExport]