diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2019-03-03 09:23:26 -0800 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2019-03-03 09:23:26 -0800 |
commit | 6c53d18eb2f4e39177174a93d9a8a981a6597962 (patch) | |
tree | 8456e315e51390560f4de68b718709705b3ae163 /haddock-api/src/Haddock/Interface.hs | |
parent | b682041ed1cbeaf5aa501f85e4e46a6d2e39da3a (diff) | |
parent | 8964666efc4d4ab9756a83d16a02115a38744408 (diff) |
Merge branch 'ghc-8.6' into ghc-8.8
Diffstat (limited to 'haddock-api/src/Haddock/Interface.hs')
-rw-r--r-- | haddock-api/src/Haddock/Interface.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index f1b2d45e..e7d30fc7 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -61,6 +61,7 @@ import Name (nameIsFromExternalPackage, nameOccName) import OccName (isTcOcc) import RdrName (unQualOK, gre_name, globalRdrEnvElts) import ErrUtils (withTiming) +import DynamicLoading (initializePlugins) #if defined(mingw32_HOST_OS) import System.IO @@ -150,7 +151,13 @@ createIfaces verbosity modules flags instIfaceMap = do processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe (Interface, ModuleSet)) processModule verbosity modsum flags modMap instIfaceMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modsum) ++ "..." - tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum + + -- Since GHC 8.6, plugins are initialized on a per module basis + hsc_env' <- getSession + dynflags' <- liftIO (initializePlugins hsc_env' (GHC.ms_hspp_opts modsum)) + let modsum' = modsum { ms_hspp_opts = dynflags' } + + tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum' if not $ isBootSummary modsum then do out verbosity verbose "Creating interface..." |