Commit 4e9017fc authored by Edward Z. Yang's avatar Edward Z. Yang

Remove unused field from 'ExposedModule' which GHC does not use.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 15e0e717
......@@ -161,8 +161,7 @@ data OriginalModule
data ExposedModule
= ExposedModule {
exposedName :: ModuleName,
exposedReexport :: Maybe OriginalModule,
exposedSignature :: Maybe OriginalModule -- This field is unused for now.
exposedReexport :: Maybe OriginalModule
}
deriving (Eq, Generic, Read, Show)
......@@ -176,14 +175,11 @@ instance Text OriginalModule where
return (OriginalModule ipi m)
instance Text ExposedModule where
disp (ExposedModule m reexport signature) =
disp (ExposedModule m reexport) =
Disp.sep [ disp m
, case reexport of
Just m' -> Disp.sep [Disp.text "from", disp m']
Nothing -> Disp.empty
, case signature of
Just m' -> Disp.sep [Disp.text "is", disp m']
Nothing -> Disp.empty
]
parse = do
m <- parseModuleNameQ
......@@ -192,12 +188,7 @@ instance Text ExposedModule where
_ <- Parse.string "from"
Parse.skipSpaces
fmap Just parse
Parse.skipSpaces
signature <- Parse.option Nothing $ do
_ <- Parse.string "is"
Parse.skipSpaces
fmap Just parse
return (ExposedModule m reexport signature)
return (ExposedModule m reexport)
instance Binary OriginalModule
......@@ -213,7 +204,7 @@ showExposedModules :: [ExposedModule] -> Disp.Doc
showExposedModules xs
| all isExposedModule xs = fsep (map disp xs)
| otherwise = fsep (Disp.punctuate comma (map disp xs))
where isExposedModule (ExposedModule _ Nothing Nothing) = True
where isExposedModule (ExposedModule _ Nothing) = True
isExposedModule _ = False
parseExposedModules :: Parse.ReadP r [ExposedModule]
......
......@@ -393,7 +393,7 @@ testSuiteLibV09AsLibAndExe pkg_descr
, componentPackageRenaming = componentPackageRenaming clbi
, componentId = cid
, componentCompatPackageKey = compat_key
, componentExposedModules = [IPI.ExposedModule m Nothing Nothing]
, componentExposedModules = [IPI.ExposedModule m Nothing]
}
pkg = pkg_descr {
package = (package pkg_descr) { pkgName = pkg_name }
......
......@@ -1544,7 +1544,7 @@ mkComponentsLocalBuildInfo cfg comp installedPackages pkg_descr
componentLocalBuildInfo cid compat_key component =
case component of
CLib lib -> do
let exports = map (\n -> Installed.ExposedModule n Nothing Nothing)
let exports = map (\n -> Installed.ExposedModule n Nothing)
(PD.exposedModules lib)
let mb_reexports = resolveModuleReexports installedPackages
(packageId pkg_descr)
......@@ -1649,7 +1649,6 @@ resolveModuleReexports installedPackages srcpkgid key externalPkgDeps lib =
definingModuleName
exposedModule = Installed.ExposedModule visibleModuleName
(Just originalModule)
Nothing
]
-- All the modules exported from this package and their defining name and
......
......@@ -67,7 +67,7 @@ mkComponentId = Current.ComponentId . display
toCurrent :: InstalledPackageInfo -> Current.InstalledPackageInfo
toCurrent ipi@InstalledPackageInfo{} =
let pid = convertPackageId (package ipi)
mkExposedModule m = Current.ExposedModule m Nothing Nothing
mkExposedModule m = Current.ExposedModule m Nothing
in Current.InstalledPackageInfo {
Current.sourcePackageId = pid,
Current.installedComponentId = mkComponentId pid,
......
......@@ -18,7 +18,6 @@ import Distribution.Simple.GHC.ImplInfo
import qualified Distribution.Simple.GHC.Internal as Internal
import Distribution.PackageDescription as PD
import Distribution.InstalledPackageInfo
import qualified Distribution.InstalledPackageInfo as InstalledPackageInfo
import Distribution.Package
import Distribution.Simple.PackageIndex ( InstalledPackageIndex )
import qualified Distribution.Simple.PackageIndex as PackageIndex
......
......@@ -63,13 +63,11 @@ import Distribution.Simple.InstallDirs hiding (absoluteInstallDirs,
substPathTemplate, )
import qualified Distribution.Simple.InstallDirs as InstallDirs
import Distribution.Simple.Program
import Distribution.InstalledPackageInfo
import Distribution.PackageDescription
import qualified Distribution.InstalledPackageInfo as Installed
import Distribution.Package
import Distribution.Simple.Compiler
import Distribution.Simple.PackageIndex
import Distribution.ModuleName
import Distribution.Simple.Setup
import Distribution.Simple.Utils
import Distribution.Text
......
......@@ -595,7 +595,7 @@ moduleNameIndex :: InstalledPackageIndex -> Map ModuleName [IPI.InstalledPackage
moduleNameIndex index =
Map.fromListWith (++) $ do
pkg <- allPackages index
IPI.ExposedModule m reexport _ <- IPI.exposedModules pkg
IPI.ExposedModule m reexport <- IPI.exposedModules pkg
case reexport of
Nothing -> return (m, [pkg])
Just (IPI.OriginalModule _ m') | m == m' -> []
......
......@@ -27,7 +27,6 @@ import Distribution.Utils.NubList
import Language.Haskell.Extension
import qualified Data.Map as M
import Data.List ( intercalate )
-- | A structured set of GHC options/flags
--
......
......@@ -71,7 +71,6 @@ import Distribution.ReadE
import Distribution.Text
import qualified Distribution.Compat.ReadP as Parse
import qualified Text.PrettyPrint as Disp
import Distribution.ModuleName
import Distribution.Package
import Distribution.PackageDescription hiding (Flag)
import Distribution.Simple.Command hiding (boolOpt, boolOpt')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment