diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-07 20:04:44 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:02 -0400 |
commit | f6be6e432e53108075905c1fc7785d8b1f18a33f (patch) | |
tree | 299c122f83b982f3edfd4b56bcf1967191e5cb48 /compiler/GHC/HsToCore/Usage.hs | |
parent | 8dc71f5577a541168951371bd55b51a588b57813 (diff) | |
download | haskell-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 'compiler/GHC/HsToCore/Usage.hs')
-rw-r--r-- | compiler/GHC/HsToCore/Usage.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore/Usage.hs b/compiler/GHC/HsToCore/Usage.hs index 7a00d75b23..97ab4ba89a 100644 --- a/compiler/GHC/HsToCore/Usage.hs +++ b/compiler/GHC/HsToCore/Usage.hs @@ -169,7 +169,7 @@ One way to improve this is to either: -} mkPluginUsage :: HscEnv -> ModIface -> IO [Usage] mkPluginUsage hsc_env pluginModule - = case lookupPluginModuleWithSuggestions dflags pNm Nothing of + = case lookupPluginModuleWithSuggestions pkgs pNm Nothing of LookupFound _ pkg -> do -- The plugin is from an external package: -- search for the library files containing the plugin. @@ -215,6 +215,7 @@ mkPluginUsage hsc_env pluginModule where dflags = hsc_dflags hsc_env platform = targetPlatform dflags + pkgs = pkgState dflags pNm = moduleName $ mi_module pluginModule pPkg = moduleUnit $ mi_module pluginModule deps = map gwib_mod $ |