diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-01-05 15:54:42 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-01-05 16:14:31 -0500 |
commit | 1e56f63c3197e7ca1c1e506e083c2bad25d08793 (patch) | |
tree | 7152e5a53fe1c18e6fd5044d5aa3168ab99c3cc6 /haddock-api/src/Haddock/Interface.hs | |
parent | 1d657cf377b5f147b08aafb3ab3a5d11be538331 (diff) | |
parent | 665226f384ee9b0a66a98638ede9eff845f6c45b (diff) |
Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0
Diffstat (limited to 'haddock-api/src/Haddock/Interface.hs')
-rw-r--r-- | haddock-api/src/Haddock/Interface.hs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index fa20b836..1501919b 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -43,11 +43,11 @@ import Haddock.Types import Haddock.Utils import Control.Monad +import Control.Monad.IO.Class ( liftIO ) import Control.Exception (evaluate) -import Data.List +import Data.List (foldl', isPrefixOf, nub) import qualified Data.Map as Map import qualified Data.Set as Set -import Distribution.Verbosity import Text.Printf import GHC.Unit.Module.Env (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet) @@ -62,6 +62,7 @@ import GHC.Types.Name.Occurrence (isTcOcc) import GHC.Types.Name.Reader (unQualOK, gre_name, globalRdrEnvElts) import GHC.Utils.Error (withTimingD) import GHC.HsToCore.Docs +import GHC.Runtime.Loader (initializePlugins) #if defined(mingw32_HOST_OS) import System.IO @@ -111,7 +112,7 @@ processModules verbosity modules flags extIfaces = do let warnings = Flag_NoWarnings `notElem` flags dflags <- getDynFlags let (interfaces'', msgs) = - runWriter $ mapM (renameInterface dflags links warnings) interfaces' + runWriter $ mapM (renameInterface dflags (ignoredSymbols flags) links warnings) interfaces' liftIO $ mapM_ putStrLn msgs return (interfaces'', homeLinks) @@ -151,7 +152,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' case isBootSummary modsum of IsBoot -> |