aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 662226a8..cb444844 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -67,6 +67,7 @@ import Text.ParserCombinators.ReadP (readP_to_S)
import GHC hiding (verbosity)
import GHC.Settings.Config
import GHC.Driver.Session hiding (projectVersion, verbosity)
+import GHC.Driver.Env
import GHC.Utils.Error
import GHC.Unit
import GHC.Utils.Panic (handleGhcException)
@@ -471,10 +472,10 @@ withGhc' libDir needHieFiles flags ghcActs = runGhc (Just libDir) $ do
-- that may need to be re-linked: Haddock doesn't do any
-- dynamic or static linking at all!
_ <- setSessionDynFlags dynflags''
- hscenv <- GHC.getSession
- dynflags''' <- liftIO (GHC.Runtime.Loader.initializePlugins hscenv dynflags'')
- _ <- setSessionDynFlags dynflags'''
- ghcActs dynflags'''
+ hsc_env <- GHC.getSession
+ hsc_env'' <- liftIO (GHC.Runtime.Loader.initializePlugins hsc_env)
+ _ <- GHC.setSession hsc_env''
+ ghcActs (hsc_dflags hsc_env'')
where
-- ignore sublists of flags that start with "+RTS" and end in "-RTS"