diff options
Diffstat (limited to 'compiler/GHC/Runtime')
-rw-r--r-- | compiler/GHC/Runtime/Context.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Loader.hs | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/compiler/GHC/Runtime/Context.hs b/compiler/GHC/Runtime/Context.hs index a1df5fd029..8222e96ce8 100644 --- a/compiler/GHC/Runtime/Context.hs +++ b/compiler/GHC/Runtime/Context.hs @@ -284,7 +284,7 @@ data InteractiveContext ic_cwd :: Maybe FilePath, -- ^ virtual CWD of the program - ic_plugins :: ![LoadedPlugin] + ic_plugins :: !Plugins -- ^ Cache of loaded plugins. We store them here to avoid having to -- load them everytime we switch to the interctive context. } @@ -321,7 +321,7 @@ emptyInteractiveContext dflags ic_default = Nothing, ic_resume = [], ic_cwd = Nothing, - ic_plugins = [] + ic_plugins = emptyPlugins } icReaderEnv :: InteractiveContext -> GlobalRdrEnv diff --git a/compiler/GHC/Runtime/Loader.hs b/compiler/GHC/Runtime/Loader.hs index 704f499a4f..e93e6969bc 100644 --- a/compiler/GHC/Runtime/Loader.hs +++ b/compiler/GHC/Runtime/Loader.hs @@ -74,14 +74,16 @@ import GHC.Unit.Types (ModuleNameWithIsBoot) initializePlugins :: HscEnv -> Maybe ModuleNameWithIsBoot -> IO HscEnv initializePlugins hsc_env mnwib -- plugins not changed - | map lpModuleName (hsc_plugins hsc_env) == reverse (pluginModNames dflags) + | loaded_plugins <- loadedPlugins (hsc_plugins hsc_env) + , map lpModuleName loaded_plugins == reverse (pluginModNames dflags) -- arguments not changed - , all same_args (hsc_plugins hsc_env) - = return hsc_env -- no need to reload plugins + , all same_args loaded_plugins + = return hsc_env -- no need to reload plugins FIXME: doesn't take static plugins into account | otherwise = do loaded_plugins <- loadPlugins hsc_env mnwib - let hsc_env' = hsc_env { hsc_plugins = loaded_plugins } - withPlugins hsc_env' driverPlugin hsc_env' + let plugins' = (hsc_plugins hsc_env) { loadedPlugins = loaded_plugins } + let hsc_env' = hsc_env { hsc_plugins = plugins' } + withPlugins (hsc_plugins hsc_env') driverPlugin hsc_env' where plugin_args = pluginModNameOpts dflags same_args p = paArguments (lpPlugin p) == argumentsForPlugin p plugin_args |