diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-18 12:00:11 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:03 -0400 |
commit | bd5810dc4e23331ca4f73ec3b1818c3350b5bbd7 (patch) | |
tree | 61ca33512862bb4ad8dd4932b459b7dcc7217cd3 /compiler | |
parent | 9e715c1b84702dc60fe31fd19dacf85335d59b27 (diff) | |
download | haskell-bd5810dc4e23331ca4f73ec3b1818c3350b5bbd7.tar.gz |
DynFlags: remove useless add_package parameter
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Unit/State.hs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/GHC/Unit/State.hs b/compiler/GHC/Unit/State.hs index a241318b70..2dd0941986 100644 --- a/compiler/GHC/Unit/State.hs +++ b/compiler/GHC/Unit/State.hs @@ -2021,7 +2021,7 @@ getPreloadUnitsAnd dflags pkgids0 = preload = preloadUnits state parents = zip pkgids (repeat Nothing) in do - all_pkgs <- throwErr dflags (foldM (add_package dflags pkg_map) preload parents) + all_pkgs <- throwErr dflags (foldM (add_package pkg_map) preload parents) return (map (unsafeLookupUnitId state) all_pkgs) -- Takes a list of packages, and returns the list with dependencies included, @@ -2031,7 +2031,7 @@ closeDeps :: DynFlags -> [(UnitId, Maybe UnitId)] -> IO [UnitId] closeDeps dflags pkg_map ps - = throwErr dflags (closeDepsErr dflags pkg_map ps) + = throwErr dflags (closeDepsErr pkg_map ps) throwErr :: DynFlags -> MaybeErr MsgDoc a -> IO a throwErr dflags m @@ -2039,19 +2039,17 @@ throwErr dflags m Failed e -> throwGhcExceptionIO (CmdLineError (showSDoc dflags e)) Succeeded r -> return r -closeDepsErr :: DynFlags - -> UnitInfoMap +closeDepsErr :: UnitInfoMap -> [(UnitId,Maybe UnitId)] -> MaybeErr MsgDoc [UnitId] -closeDepsErr dflags pkg_map ps = foldM (add_package dflags pkg_map) [] ps +closeDepsErr pkg_map ps = foldM (add_package pkg_map) [] ps -- internal helper -add_package :: DynFlags - -> UnitInfoMap +add_package :: UnitInfoMap -> [UnitId] -> (UnitId,Maybe UnitId) -> MaybeErr MsgDoc [UnitId] -add_package dflags pkg_map ps (p, mb_parent) +add_package pkg_map ps (p, mb_parent) | p `elem` ps = return ps -- Check if we've already added this package | otherwise = case lookupUnitId' pkg_map p of @@ -2063,7 +2061,7 @@ add_package dflags pkg_map ps (p, mb_parent) return (p : ps') where add_unit_key ps key - = add_package dflags pkg_map ps (key, Just p) + = add_package pkg_map ps (key, Just p) missingPackageMsg :: Outputable pkgid => pkgid -> SDoc missingPackageMsg p = text "unknown package:" <+> ppr p |