summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-18 11:58:43 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-13 02:13:03 -0400
commit9e715c1b84702dc60fe31fd19dacf85335d59b27 (patch)
treede2c79fdc8beade3c1bc97ec0bb961808d14c3f3 /compiler
parent266bc3d9c3735620598ab18ff6ac9c44134cbbff (diff)
downloadhaskell-9e715c1b84702dc60fe31fd19dacf85335d59b27.tar.gz
Document getPreloadUnitsAnd
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Unit/State.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Unit/State.hs b/compiler/GHC/Unit/State.hs
index 65acf20cd4..a241318b70 100644
--- a/compiler/GHC/Unit/State.hs
+++ b/compiler/GHC/Unit/State.hs
@@ -2002,8 +2002,9 @@ listVisibleModuleNames dflags =
map fst (filter visible (Map.toList (moduleNameProvidersMap (unitState dflags))))
where visible (_, ms) = any originVisible (Map.elems ms)
--- | Find all the 'UnitInfo' in both the preload packages from 'DynFlags' and corresponding to the list of
--- 'UnitInfo's
+-- | Lookup 'UnitInfo' for every preload unit, for every unit used to
+-- instantiate the current unit, and for every unit explicitly passed in the
+-- given list of UnitId.
getPreloadUnitsAnd :: DynFlags -> [UnitId] -> IO [UnitInfo]
getPreloadUnitsAnd dflags pkgids0 =
let
@@ -2018,9 +2019,9 @@ getPreloadUnitsAnd dflags pkgids0 =
state = unitState dflags
pkg_map = unitInfoMap state
preload = preloadUnits state
- pairs = zip pkgids (repeat Nothing)
+ parents = zip pkgids (repeat Nothing)
in do
- all_pkgs <- throwErr dflags (foldM (add_package dflags pkg_map) preload pairs)
+ all_pkgs <- throwErr dflags (foldM (add_package dflags pkg_map) preload parents)
return (map (unsafeLookupUnitId state) all_pkgs)
-- Takes a list of packages, and returns the list with dependencies included,