summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Env.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-12-24 17:30:38 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-24 05:37:52 -0500
commit1d1dd3fbfafdb9705076d4c587d5cf47e33b7640 (patch)
tree514629de18288f32a7d6e52cafa1c4f81e00ce95 /compiler/GHC/Unit/Env.hs
parenteee3bf05f8ee29ae6c01a29db9502a390720f3b5 (diff)
downloadhaskell-1d1dd3fbfafdb9705076d4c587d5cf47e33b7640.tar.gz
Fix recompilation checking for multiple home units
The key part of this change is to store a UnitId in the `UsageHomeModule` and `UsageHomeModuleInterface`. * Fine-grained dependency tracking is used if the dependency comes from any home unit. * We actually look up the right module when checking whether we need to recompile in the `UsageHomeModuleInterface` case. These scenarios are both checked by the new tests ( multipleHomeUnits_recomp and multipleHomeUnits_recomp_th ) Fixes #22675
Diffstat (limited to 'compiler/GHC/Unit/Env.hs')
-rw-r--r--compiler/GHC/Unit/Env.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Unit/Env.hs b/compiler/GHC/Unit/Env.hs
index ade158ddad..a34ae550e0 100644
--- a/compiler/GHC/Unit/Env.hs
+++ b/compiler/GHC/Unit/Env.hs
@@ -14,6 +14,7 @@ module GHC.Unit.Env
, ue_setUnits
, ue_setUnitFlags
, ue_unit_dbs
+ , ue_all_home_unit_ids
, ue_setUnitDbs
, ue_hpt
, ue_homeUnit
@@ -442,7 +443,8 @@ ue_unitHomeUnit_maybe uid ue_env =
ue_unitHomeUnit :: UnitId -> UnitEnv -> HomeUnit
ue_unitHomeUnit uid ue_env = homeUnitEnv_unsafeHomeUnit $ ue_findHomeUnitEnv uid ue_env
-
+ue_all_home_unit_ids :: UnitEnv -> Set.Set UnitId
+ue_all_home_unit_ids = unitEnv_keys . ue_home_unit_graph
-- -------------------------------------------------------
-- Query and modify the currently active unit
-- -------------------------------------------------------
@@ -462,6 +464,7 @@ ue_setActiveUnit u ue_env = assertUnitEnvInvariant $ ue_env
ue_currentUnit :: UnitEnv -> UnitId
ue_currentUnit = ue_current_unit
+
-- -------------------------------------------------------
-- Operations on arbitrary elements of the home unit graph
-- -------------------------------------------------------