Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.fendor-experiment at Glasgow Haskell Compiler / GHC
Commits:
-
da4c4d9f
by Wolfgang Jeltsch at 2026-04-11T16:23:36+03:00
-
c6a61c47
by Wolfgang Jeltsch at 2026-04-11T16:30:04+03:00
2 changed files:
Changes:
| ... | ... | @@ -255,7 +255,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg = |
| 255 | 255 | let providers = maybe dep_providers (\u -> Set.delete u dep_providers) current_unit_id
|
| 256 | 256 | in Set.toList providers
|
| 257 | 257 | unknown_units =
|
| 258 | - let candidates = Set.difference hpt_deps complete_units
|
|
| 258 | + let candidates = Set.empty -- Set.difference hpt_deps complete_units
|
|
| 259 | 259 | excluded = maybe dep_providers (\u -> Set.insert u dep_providers) current_unit_id
|
| 260 | 260 | in Set.toList (Set.difference candidates excluded)
|
| 261 | 261 | other_home_uids = known_other_uids ++ unknown_units
|
| ... | ... | @@ -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
|