Wolfgang Jeltsch pushed to branch wip/jeltsch/improve-closure-property-check at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Driver/Downsweep.hs
    ... ... @@ -57,7 +57,6 @@ import Language.Haskell.Syntax.ImpExp
    57 57
     import GHC.Types.UnresolvedImport
    
    58 58
     
    
    59 59
     import GHC.Data.FastString
    
    60
    -import GHC.Data.ShortText  ( ShortText )
    
    61 60
     import GHC.Data.Maybe      ( expectJust )
    
    62 61
     import qualified GHC.Data.Maybe as M
    
    63 62
     import GHC.Data.OsPath     ( OsPath, unsafeEncodeUtf )
    
    ... ... @@ -96,6 +95,7 @@ import GHC.Unit.Module.Graph
    96 95
     import GHC.Unit.Module.Deps
    
    97 96
     import qualified GHC.Unit.Home.Graph as HUG
    
    98 97
     import GHC.Unit.Module.Stage
    
    98
    +import GHC.Unit.External.Index (UnitAbiHash)
    
    99 99
     
    
    100 100
     import Data.Either ( partitionEithers, lefts )
    
    101 101
     import Data.Map (Map)
    
    ... ... @@ -979,7 +979,7 @@ checkHomeUnitsClosed unit_env
    979 979
         collect :: [UnitState]
    
    980 980
                    -- ^ The 'UnitState's of the home units from which to traverse
    
    981 981
                    --   the dependency graph.
    
    982
    -            -> State (UniqMap UnitId (Set ShortText)) [(UnitId, UnitId)]
    
    982
    +            -> State (UniqMap UnitId (Set UnitAbiHash)) [(UnitId, UnitId)]
    
    983 983
                    -- ^ A stateful computation that collects offending dependencies
    
    984 984
                    --   that have not yet been found. It uses its state, which is an
    
    985 985
                    --   efficent representation of a set of 'GlobalUnitKey's, to
    
    ... ... @@ -999,7 +999,7 @@ checkHomeUnitsClosed unit_env
    999 999
             -> [UnitId]
    
    1000 1000
                -- ^ The 'UnitId's of the units from which to traverse the dependency
    
    1001 1001
                --   graph.
    
    1002
    -        -> State (UniqMap UnitId (Set ShortText)) [(UnitId, UnitId)]
    
    1002
    +        -> State (UniqMap UnitId (Set UnitAbiHash)) [(UnitId, UnitId)]
    
    1003 1003
                -- ^ A stateful computation that collects offending dependencies that
    
    1004 1004
                --   have not yet been found. It uses its state, which is an efficent
    
    1005 1005
                --   representation of a set of 'GlobalUnitKey's, to keep track of
    
    ... ... @@ -1022,7 +1022,7 @@ checkHomeUnitsClosed unit_env
    1022 1022
                 unit_not_found_msg = "Unit not found during closure property check"
    
    1023 1023
     
    
    1024 1024
               -- | The ABI hash of the current unit.
    
    1025
    -          unit_abi_hash :: ShortText
    
    1025
    +          unit_abi_hash :: UnitAbiHash
    
    1026 1026
               unit_abi_hash = unitAbiHash unit_info
    
    1027 1027
     
    
    1028 1028
             has_been_processed <- gets $ maybe False (Set.member unit_abi_hash) .