summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Make.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-01-12 14:56:41 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-22 18:27:00 -0500
commitfd0945b7bfa1e36ca79d74f8e6e0918a66d62608 (patch)
treea57bd43ad0b6d87e69f36e52802d28d9c4de5076 /compiler/GHC/Driver/Make.hs
parentece202297454862717cef8c06d445f8405845b28 (diff)
downloadhaskell-fd0945b7bfa1e36ca79d74f8e6e0918a66d62608.tar.gz
Move Hooks into HscEnv
Diffstat (limited to 'compiler/GHC/Driver/Make.hs')
-rw-r--r--compiler/GHC/Driver/Make.hs20
1 files changed, 16 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index c36e11914e..f13d13b198 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -617,8 +617,14 @@ load' how_much mHscMessage mod_graph = do
do_linking = a_root_is_Main || no_hs_main || ghcLink dflags == LinkDynLib || ghcLink dflags == LinkStaticLib
-- link everything together
- unit_env <- hsc_unit_env <$> getSession
- linkresult <- liftIO $ link (ghcLink dflags) logger dflags unit_env do_linking (hsc_HPT hsc_env1)
+ hsc_env <- getSession
+ linkresult <- liftIO $ link (ghcLink dflags)
+ logger
+ (hsc_hooks hsc_env)
+ dflags
+ (hsc_unit_env hsc_env)
+ do_linking
+ (hsc_HPT hsc_env1)
if ghcLink dflags == LinkBinary && isJust ofile && not do_linking
then do
@@ -677,8 +683,14 @@ load' how_much mHscMessage mod_graph = do
ASSERT( just_linkables ) do
-- Link everything together
- unit_env <- hsc_unit_env <$> getSession
- linkresult <- liftIO $ link (ghcLink dflags) logger dflags unit_env False hpt5
+ hsc_env <- getSession
+ linkresult <- liftIO $ link (ghcLink dflags)
+ logger
+ (hsc_hooks hsc_env)
+ dflags
+ (hsc_unit_env hsc_env)
+ False
+ hpt5
modifySession $ \hsc_env -> hsc_env{ hsc_HPT = hpt5 }
loadFinish Failed linkresult