summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-13 11:32:41 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-13 02:13:03 -0400
commited533ec217667423e4fce30040f24053dbcc7de4 (patch)
treea810bd338fb4044538fba0c78df041a3e2c225e1 /compiler/GHC.hs
parentf50c19b8a78da9252cb39f49c1c66db4a684cc3b (diff)
downloadhaskell-ed533ec217667423e4fce30040f24053dbcc7de4.tar.gz
Rename Package into Unit
The terminology changed over time and now package databases contain "units" (there can be several units compiled from a single Cabal package: one per-component, one for each option set, one per instantiation, etc.). We should try to be consistent internally and use "units": that's what this renaming does. Maybe one day we'll fix the UI too (e.g. replace -package-id with -unit-id, we already have -this-unit-id and ghc-pkg has -unit-id...) but it's not done in this patch. * rename getPkgFrameworkOpts into getUnitFrameworkOpts * rename UnitInfoMap into ClosureUnitInfoMap * rename InstalledPackageIndex into UnitInfoMap * rename UnusablePackages into UnusableUnits * rename PackagePrecedenceIndex into UnitPrecedenceMap * rename PackageDatabase into UnitDatabase * rename pkgDatabase into unitDatabases * rename pkgState into unitState * rename initPackages into initUnits * rename renamePackage into renameUnitInfo * rename UnusablePackageReason into UnusableUnitReason * rename getPackage* into getUnit* * etc.
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index f95c61ace5..1aebb96c0f 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -597,7 +597,7 @@ checkBrokenTablesNextToCode' dflags
setSessionDynFlags :: GhcMonad m => DynFlags -> m [UnitId]
setSessionDynFlags dflags = do
dflags' <- checkNewDynFlags dflags
- (dflags''', preload) <- liftIO $ initPackages dflags'
+ (dflags''', preload) <- liftIO $ initUnits dflags'
-- Interpreter
interp <- if gopt Opt_ExternalInterpreter dflags
@@ -660,7 +660,7 @@ setProgramDynFlags_ invalidate_needed dflags = do
dflags_prev <- getProgramDynFlags
(dflags'', preload) <-
if (packageFlagsChanged dflags_prev dflags')
- then liftIO $ initPackages dflags'
+ then liftIO $ initUnits dflags'
else return (dflags', [])
modifySession $ \h -> h{ hsc_dflags = dflags'' }
when invalidate_needed $ invalidateModSummaryCache
@@ -699,7 +699,7 @@ getProgramDynFlags = getSessionDynFlags
-- | Set the 'DynFlags' used to evaluate interactive expressions.
-- Note: this cannot be used for changes to packages. Use
-- 'setSessionDynFlags', or 'setProgramDynFlags' and then copy the
--- 'pkgState' into the interactive @DynFlags@.
+-- 'unitState' into the interactive @DynFlags@.
setInteractiveDynFlags :: GhcMonad m => DynFlags -> m ()
setInteractiveDynFlags dflags = do
dflags' <- checkNewDynFlags dflags
@@ -1355,7 +1355,7 @@ packageDbModules :: GhcMonad m =>
-> m [Module]
packageDbModules only_exposed = do
dflags <- getSessionDynFlags
- let pkgs = eltsUFM (unitInfoMap (pkgState dflags))
+ let pkgs = eltsUFM (unitInfoMap (unitState dflags))
return $
[ mkModule pid modname
| p <- pkgs