diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-13 11:32:41 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:03 -0400 |
commit | ed533ec217667423e4fce30040f24053dbcc7de4 (patch) | |
tree | a810bd338fb4044538fba0c78df041a3e2c225e1 /ghc | |
parent | f50c19b8a78da9252cb39f49c1c66db4a684cc3b (diff) | |
download | haskell-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 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 8 | ||||
-rw-r--r-- | ghc/Main.hs | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 18976c2c88..a17cbe01e1 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -2360,12 +2360,12 @@ isSafeModule m = do packageTrusted dflags md | isHomeModule dflags md = True - | otherwise = unitIsTrusted $ unsafeLookupUnit (pkgState dflags) (moduleUnit md) + | otherwise = unitIsTrusted $ unsafeLookupUnit (unitState dflags) (moduleUnit md) tallyPkgs dflags deps | not (packageTrustOn dflags) = (S.empty, S.empty) | otherwise = S.partition part deps where part pkg = unitIsTrusted $ unsafeLookupUnitId pkgstate pkg - pkgstate = pkgState dflags + pkgstate = unitState dflags ----------------------------------------------------------------------------- -- :browse @@ -2952,8 +2952,8 @@ newDynFlags interactive_only minus_opts = do -- and copy the package state to the interactive DynFlags idflags <- GHC.getInteractiveDynFlags GHC.setInteractiveDynFlags - idflags{ pkgState = pkgState dflags2 - , pkgDatabase = pkgDatabase dflags2 + idflags{ unitState = unitState dflags2 + , unitDatabases = unitDatabases dflags2 , packageFlags = packageFlags dflags2 } let ld0length = length $ ldInputs dflags0 diff --git a/ghc/Main.hs b/ghc/Main.hs index 655b03e7bd..bd2028b70b 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -865,9 +865,9 @@ dumpFastStringStats dflags = do x `pcntOf` y = int ((x * 100) `quot` y) Outputable.<> char '%' showPackages, dumpPackages, dumpPackagesSimple :: DynFlags -> IO () -showPackages dflags = putStrLn (showSDoc dflags (pprPackages (pkgState dflags))) -dumpPackages dflags = putMsg dflags (pprPackages (pkgState dflags)) -dumpPackagesSimple dflags = putMsg dflags (pprPackagesSimple (pkgState dflags)) +showPackages dflags = putStrLn (showSDoc dflags (pprPackages (unitState dflags))) +dumpPackages dflags = putMsg dflags (pprPackages (unitState dflags)) +dumpPackagesSimple dflags = putMsg dflags (pprPackagesSimple (unitState dflags)) -- ----------------------------------------------------------------------------- -- Frontend plugin support |