summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-10-11 11:03:10 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-10-14 21:40:49 -0700
commitb92a51f5e235fc22a9ae0d76735b50f095665fb7 (patch)
tree27eb41de475255206185e68c535c2d899012fa1b /compiler/main/DynFlags.hs
parent5b0191f74ab05b187f81ea037623338a615b1619 (diff)
downloadhaskell-b92a51f5e235fc22a9ae0d76735b50f095665fb7.tar.gz
Rename package key to unit ID, and installed package ID to component ID.
Comes with Haddock submodule update. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs30
1 files changed, 15 insertions, 15 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index c03f076ef0..003211520d 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -92,7 +92,7 @@ module DynFlags (
getVerbFlags,
updOptLevel,
setTmpDir,
- setPackageKey,
+ setUnitId,
interpretPackageEnv,
-- ** Parsing DynFlags
@@ -704,7 +704,7 @@ data DynFlags = DynFlags {
solverIterations :: IntWithInf, -- ^ Number of iterations in the constraints solver
-- Typically only 1 is needed
- thisPackage :: PackageKey, -- ^ key of package currently being compiled
+ thisPackage :: UnitId, -- ^ key of package currently being compiled
-- ways
ways :: [Way], -- ^ Way flags from the command line
@@ -1117,7 +1117,7 @@ isNoLink _ = False
data PackageArg =
PackageArg String -- ^ @-package@, by 'PackageName'
| PackageIdArg String -- ^ @-package-id@, by 'SourcePackageId'
- | PackageKeyArg String -- ^ @-package-key@, by 'InstalledPackageId'
+ | UnitIdArg String -- ^ @-package-key@, by 'ComponentId'
deriving (Eq, Show)
-- | Represents the renaming that may be associated with an exposed
@@ -1435,7 +1435,7 @@ defaultDynFlags mySettings =
reductionDepth = treatZeroAsInf mAX_REDUCTION_DEPTH,
solverIterations = treatZeroAsInf mAX_SOLVER_ITERATIONS,
- thisPackage = mainPackageKey,
+ thisPackage = mainUnitId,
objectDir = Nothing,
dylibInstallName = Nothing,
@@ -1916,7 +1916,7 @@ parseSigOf str = case filter ((=="").snd) (readP_to_S parse str) of
pk <- munch1 (\c -> isAlphaNum c || c `elem` "-_.")
_ <- R.char ':'
m <- parseModuleName
- return (mkModule (stringToPackageKey pk) m)
+ return (mkModule (stringToUnitId pk) m)
tok m = skipSpaces >> m
setSigOf :: String -> DynFlags -> DynFlags
@@ -2725,12 +2725,12 @@ package_flags = [
deprecate "Use -no-user-package-db instead")
, defGhcFlag "package-name" (HasArg $ \name -> do
- upd (setPackageKey name)
+ upd (setUnitId name)
deprecate "Use -this-package-key instead")
- , defGhcFlag "this-package-key" (hasArg setPackageKey)
+ , defGhcFlag "this-package-key" (hasArg setUnitId)
, defFlag "package-id" (HasArg exposePackageId)
, defFlag "package" (HasArg exposePackage)
- , defFlag "package-key" (HasArg exposePackageKey)
+ , defFlag "package-key" (HasArg exposeUnitId)
, defFlag "hide-package" (HasArg hidePackage)
, defFlag "hide-all-packages" (NoArg (setGeneralFlag Opt_HideAllPackages))
, defFlag "package-env" (HasArg setPackageEnv)
@@ -3706,15 +3706,15 @@ parsePackageFlag constr str = case filter ((=="").snd) (readP_to_S parse str) of
return (orig, orig))
tok m = m >>= \x -> skipSpaces >> return x
-exposePackage, exposePackageId, exposePackageKey, hidePackage, ignorePackage,
+exposePackage, exposePackageId, exposeUnitId, hidePackage, ignorePackage,
trustPackage, distrustPackage :: String -> DynP ()
exposePackage p = upd (exposePackage' p)
exposePackageId p =
upd (\s -> s{ packageFlags =
parsePackageFlag PackageIdArg p : packageFlags s })
-exposePackageKey p =
+exposeUnitId p =
upd (\s -> s{ packageFlags =
- parsePackageFlag PackageKeyArg p : packageFlags s })
+ parsePackageFlag UnitIdArg p : packageFlags s })
hidePackage p =
upd (\s -> s{ packageFlags = HidePackage p : packageFlags s })
ignorePackage p =
@@ -3729,8 +3729,8 @@ exposePackage' p dflags
= dflags { packageFlags =
parsePackageFlag PackageArg p : packageFlags dflags }
-setPackageKey :: String -> DynFlags -> DynFlags
-setPackageKey p s = s{ thisPackage = stringToPackageKey p }
+setUnitId :: String -> DynFlags -> DynFlags
+setUnitId p s = s{ thisPackage = stringToUnitId p }
-- -----------------------------------------------------------------------------
-- | Find the package environment (if one exists)
@@ -3879,10 +3879,10 @@ setMainIs arg
| not (null main_fn) && isLower (head main_fn)
-- The arg looked like "Foo.Bar.baz"
= upd $ \d -> d{ mainFunIs = Just main_fn,
- mainModIs = mkModule mainPackageKey (mkModuleName main_mod) }
+ mainModIs = mkModule mainUnitId (mkModuleName main_mod) }
| isUpper (head arg) -- The arg looked like "Foo" or "Foo.Bar"
- = upd $ \d -> d{ mainModIs = mkModule mainPackageKey (mkModuleName arg) }
+ = upd $ \d -> d{ mainModIs = mkModule mainUnitId (mkModuleName arg) }
| otherwise -- The arg looked like "baz"
= upd $ \d -> d{ mainFunIs = Just arg }