summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-07 20:04:44 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-13 02:13:02 -0400
commitf6be6e432e53108075905c1fc7785d8b1f18a33f (patch)
tree299c122f83b982f3edfd4b56bcf1967191e5cb48 /ghc
parent8dc71f5577a541168951371bd55b51a588b57813 (diff)
downloadhaskell-f6be6e432e53108075905c1fc7785d8b1f18a33f.tar.gz
Add allowVirtualUnits field in PackageState
Instead of always querying DynFlags to know whether we are allowed to use virtual units (i.e. instantiated on-the-fly, cf Note [About units] in GHC.Unit), we store it once for all in `PackageState.allowVirtualUnits`. This avoids using DynFlags too much (cf #17957) and is preliminary work for #14335.
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 17f8706308..5630f32d7a 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -2360,7 +2360,7 @@ isSafeModule m = do
packageTrusted dflags md
| isHomeModule dflags md = True
- | otherwise = unitIsTrusted $ unsafeLookupUnit dflags (moduleUnit md)
+ | otherwise = unitIsTrusted $ unsafeLookupUnit (pkgState dflags) (moduleUnit md)
tallyPkgs dflags deps | not (packageTrustOn dflags) = (S.empty, S.empty)
| otherwise = S.partition part deps