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 /compiler/GHC/Driver/Session.hs | |
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 'compiler/GHC/Driver/Session.hs')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 9f4c30096e..f301024c9a 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -254,7 +254,7 @@ import GHC.Unit.Module import {-# SOURCE #-} GHC.Driver.Plugins import {-# SOURCE #-} GHC.Driver.Hooks import GHC.Builtin.Names ( mAIN ) -import {-# SOURCE #-} GHC.Unit.State (PackageState, emptyPackageState, PackageDatabase, updateIndefUnitId) +import {-# SOURCE #-} GHC.Unit.State (PackageState, emptyPackageState, UnitDatabase, updateIndefUnitId) import GHC.Driver.Phases ( Phase(..), phaseInputExt ) import GHC.Driver.Flags import GHC.Driver.Ways @@ -617,7 +617,7 @@ data DynFlags = DynFlags { -- *reverse* order that they're specified on the command line. -- This is intended to be applied with the list of "initial" -- package databases derived from @GHC_PACKAGE_PATH@; see - -- 'getPackageConfRefs'. + -- 'getPackageDbRefs'. ignorePackageFlags :: [IgnorePackageFlag], -- ^ The @-ignore-package@ flags from the command line. @@ -634,21 +634,18 @@ data DynFlags = DynFlags { packageEnv :: Maybe FilePath, -- ^ Filepath to the package environment file (if overriding default) - pkgDatabase :: Maybe [PackageDatabase UnitId], - -- ^ Stack of package databases for the target platform. + unitDatabases :: Maybe [UnitDatabase UnitId], + -- ^ Stack of unit databases for the target platform. -- - -- A "package database" is a misleading name as it is really a Unit - -- database (cf Note [About Units]). - -- - -- This field is populated by `initPackages`. + -- This field is populated by `initUnits`. -- -- 'Nothing' means the databases have never been read from disk. If - -- `initPackages` is called again, it doesn't reload the databases from + -- `initUnits` is called again, it doesn't reload the databases from -- disk. - pkgState :: PackageState, - -- ^ Consolidated unit database built by 'initPackages' from the package - -- databases in 'pkgDatabase' and flags ('-ignore-package', etc.). + unitState :: PackageState, + -- ^ Consolidated unit database built by 'initUnits' from the unit + -- databases in 'unitDatabases' and flags ('-ignore-package', etc.). -- -- It also contains mapping from module names to actual Modules. @@ -1379,8 +1376,8 @@ defaultDynFlags mySettings llvmConfig = ignorePackageFlags = [], trustFlags = [], packageEnv = Nothing, - pkgDatabase = Nothing, - pkgState = emptyPackageState, + unitDatabases = Nothing, + unitState = emptyPackageState, ways = defaultWays mySettings, buildTag = waysTag (defaultWays mySettings), splitInfo = Nothing, @@ -1981,7 +1978,7 @@ homeUnit dflags = -- modules and the home unit id is the same as the instantiating unit -- id (see Note [About units] in GHC.Unit) | all (isHoleModule . snd) is && indefUnit u == homeUnitId dflags - -> mkVirtUnit (updateIndefUnitId (pkgState dflags) u) is + -> mkVirtUnit (updateIndefUnitId (unitState dflags) u) is -- otherwise it must be that we compile a fully definite units -- TODO: error when the unit is partially instantiated?? | otherwise |