summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-06-02 15:30:07 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-01 03:30:36 -0400
commitb51b4b9777d49bef5f0a1f6dcbf12ddbcfd9ef59 (patch)
tree453488a4a227bb615d321435f3849b63f25ad428 /compiler/GHC/Iface
parentf79615d2df9327cde8aae66c6ec211031b69b83c (diff)
downloadhaskell-b51b4b9777d49bef5f0a1f6dcbf12ddbcfd9ef59.tar.gz
Make withException use SDocContext instead of DynFlags
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r--compiler/GHC/Iface/Load.hs3
-rw-r--r--compiler/GHC/Iface/Recomp.hs6
2 files changed, 6 insertions, 3 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs
index 89a8ee6e20..f510e9bbda 100644
--- a/compiler/GHC/Iface/Load.hs
+++ b/compiler/GHC/Iface/Load.hs
@@ -415,7 +415,8 @@ loadInterfaceWithException :: SDoc -> Module -> WhereFrom -> IfM lcl ModIface
loadInterfaceWithException doc mod_name where_from
= do
dflags <- getDynFlags
- withException dflags (loadInterface doc mod_name where_from)
+ let ctx = initSDocContext dflags defaultUserStyle
+ withException ctx (loadInterface doc mod_name where_from)
------------------
loadInterface :: SDoc -> Module -> WhereFrom
diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs
index fc53b91d68..59c31ad566 100644
--- a/compiler/GHC/Iface/Recomp.hs
+++ b/compiler/GHC/Iface/Recomp.hs
@@ -1173,11 +1173,12 @@ getOrphanHashes hsc_env mods = do
hpt = hsc_HPT hsc_env
dflags = hsc_dflags hsc_env
pit = eps_PIT eps
+ ctx = initSDocContext dflags defaultUserStyle
get_orph_hash mod =
case lookupIfaceByModule hpt pit mod of
Just iface -> return (mi_orphan_hash (mi_final_exts iface))
Nothing -> do -- similar to 'mkHashFun'
- iface <- initIfaceLoad hsc_env . withException dflags
+ iface <- initIfaceLoad hsc_env . withException ctx
$ loadInterface (text "getOrphanHashes") mod ImportBySystem
return (mi_orphan_hash (mi_final_exts iface))
@@ -1470,6 +1471,7 @@ mkHashFun hsc_env eps name
dflags = hsc_dflags hsc_env
hpt = hsc_HPT hsc_env
pit = eps_PIT eps
+ ctx = initSDocContext dflags defaultUserStyle
occ = nameOccName name
orig_mod = nameModule name
lookup mod = do
@@ -1481,7 +1483,7 @@ mkHashFun hsc_env eps name
-- requirements; we didn't do any /real/ typechecking
-- so there's no guarantee everything is loaded.
-- Kind of a heinous hack.
- initIfaceLoad hsc_env . withException dflags
+ initIfaceLoad hsc_env . withException ctx
$ withoutDynamicNow
-- For some unknown reason, we need to reset the
-- dynamicNow bit, otherwise only dynamic