summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Env.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Unit/Env.hs')
-rw-r--r--compiler/GHC/Unit/Env.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/GHC/Unit/Env.hs b/compiler/GHC/Unit/Env.hs
index 8ba341cb6f..2655bb166c 100644
--- a/compiler/GHC/Unit/Env.hs
+++ b/compiler/GHC/Unit/Env.hs
@@ -10,6 +10,7 @@ where
import GHC.Prelude
+import GHC.Unit.External
import GHC.Unit.State
import GHC.Unit.Home
import GHC.Unit.Types
@@ -34,6 +35,11 @@ data UnitEnv = UnitEnv
-- Usually we don't reload the databases from disk if they are
-- cached, even if the database flags changed!
+ , ue_eps :: {-# UNPACK #-} !ExternalUnitCache
+ -- ^ Information about the currently loaded external packages.
+ -- This is mutable because packages will be demand-loaded during
+ -- a compilation run as required.
+
, ue_home_unit :: !(Maybe HomeUnit)
-- ^ Home unit
@@ -66,9 +72,11 @@ data UnitEnv = UnitEnv
initUnitEnv :: GhcNameVersion -> Platform -> IO UnitEnv
initUnitEnv namever platform = do
+ eps <- initExternalUnitCache
return $ UnitEnv
{ ue_units = emptyUnitState
, ue_unit_dbs = Nothing
+ , ue_eps = eps
, ue_home_unit = Nothing
, ue_hpt = emptyHomePackageTable
, ue_platform = platform