summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Module.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-10-08 16:46:51 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-09 08:55:21 -0400
commit6a243e9daaa6c17c0859f47ae3a098e680aa28cf (patch)
tree170e2a707534c1bc4c45abd11ae2438c39c6274d /compiler/GHC/Rename/Module.hs
parentdb236ffc03e5e17f71295469040da96b03ec2f87 (diff)
downloadhaskell-6a243e9daaa6c17c0859f47ae3a098e680aa28cf.tar.gz
Cache HomeUnit in HscEnv (#17957)
Instead of recreating the HomeUnit from the DynFlags every time we need it, we store it in the HscEnv.
Diffstat (limited to 'compiler/GHC/Rename/Module.hs')
-rw-r--r--compiler/GHC/Rename/Module.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs
index 2eedd939a5..7945263dc6 100644
--- a/compiler/GHC/Rename/Module.hs
+++ b/compiler/GHC/Rename/Module.hs
@@ -43,7 +43,6 @@ import GHC.Tc.Utils.Monad
import GHC.Types.ForeignCall ( CCallTarget(..) )
import GHC.Unit
-import GHC.Driver.Types ( Warnings(..), plusWarns )
import GHC.Builtin.Names( applicativeClassName, pureAName, thenAName
, monadClassName, returnMName, thenMName
, semigroupClassName, sappendName
@@ -61,7 +60,7 @@ import GHC.Types.SrcLoc as SrcLoc
import GHC.Driver.Session
import GHC.Utils.Misc ( debugIsOn, lengthExceeds, partitionWith )
import GHC.Utils.Panic
-import GHC.Driver.Types ( HscEnv, hsc_dflags )
+import GHC.Driver.Types ( Warnings(..), plusWarns, HscEnv(..))
import GHC.Data.List.SetOps ( findDupsEq, removeDups, equivClasses )
import GHC.Data.Graph.Directed ( SCC, flattenSCC, flattenSCCs, Node(..)
, stronglyConnCompFromEdgedVerticesUniq )
@@ -350,7 +349,7 @@ rnHsForeignDecl (ForeignImport { fd_name = name, fd_sig_ty = ty, fd_fi = spec })
; (ty', fvs) <- rnHsSigType (ForeignDeclCtx name) TypeLevel ty
-- Mark any PackageTarget style imports as coming from the current package
- ; let home_unit = mkHomeUnitFromFlags (hsc_dflags topEnv)
+ ; let home_unit = hsc_home_unit topEnv
spec' = patchForeignImport (homeUnitAsUnit home_unit) spec
; return (ForeignImport { fd_i_ext = noExtField