Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Unit/Module/Graph.hs
    ... ... @@ -219,22 +219,18 @@ mkHomeModuleMap nodes = ModuleNameHomeMap completeUnits providerMap where
    219 219
         providerMap
    
    220 220
             = Map.fromListWith Set.union $
    
    221 221
               [
    
    222
    -              (ms_mod_name modSummary, Set.singleton (ms_unitid modSummary)) |
    
    223
    -                  ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
    
    222
    +              (moduleName, Set.singleton unitID) |
    
    223
    +                  ModuleNode _ moduleNodeInfo <- nodes,
    
    224
    +                  let moduleName = moduleNodeInfoModuleName moduleNodeInfo,
    
    225
    +                  let unitID     = moduleNodeInfoUnitId moduleNodeInfo
    
    224 226
               ]
    
    225 227
     
    
    226 228
         completeUnits :: Set UnitId
    
    227
    -    completeUnits
    
    228
    -        = Set.fromList $
    
    229
    -          [
    
    230
    -              ms_unitid modSummary |
    
    231
    -                  ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
    
    232
    -          ]
    
    233
    -
    
    234
    -    {-NOTE:
    
    235
    -        The matching with `ModuleNodeCompile` results in nodes with
    
    236
    -        `ModuleNodeFixed` in their info being dropped.
    
    237
    -    -}
    
    229
    +    completeUnits = Set.fromList $
    
    230
    +                    [
    
    231
    +                        moduleNodeInfoUnitId moduleNodeInfo |
    
    232
    +                            ModuleNode _ moduleNodeInfo <- nodes
    
    233
    +                    ]
    
    238 234
     
    
    239 235
     mgHomeModuleMap :: ModuleGraph -> ModuleNameHomeMap
    
    240 236
     mgHomeModuleMap = mg_home_map