summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Recomp/Flags.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-11-12 10:36:58 +0100
committerSylvain Henry <sylvain@haskus.fr>2020-12-14 19:45:13 +0100
commitd0e8c10d587e4b9984526d0dfcfcb258b75733b8 (patch)
treee0993719d76f87a0f4f8eccef089526217bf5bb4 /compiler/GHC/Iface/Recomp/Flags.hs
parent92377c27e1a48d0d3776f65c7074dfeb122b46db (diff)
downloadhaskell-d0e8c10d587e4b9984526d0dfcfcb258b75733b8.tar.gz
Move Unit related fields from DynFlags to HscEnv
The unit database cache, the home unit and the unit state were stored in DynFlags while they ought to be stored in the compiler session state (HscEnv). This patch fixes this. It introduces a new UnitEnv type that should be used in the future to handle separate unit environments (especially host vs target units). Related to #17957 Bump haddock submodule
Diffstat (limited to 'compiler/GHC/Iface/Recomp/Flags.hs')
-rw-r--r--compiler/GHC/Iface/Recomp/Flags.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/GHC/Iface/Recomp/Flags.hs b/compiler/GHC/Iface/Recomp/Flags.hs
index 1c52f4e326..4e9003944d 100644
--- a/compiler/GHC/Iface/Recomp/Flags.hs
+++ b/compiler/GHC/Iface/Recomp/Flags.hs
@@ -10,8 +10,10 @@ module GHC.Iface.Recomp.Flags (
import GHC.Prelude
-import GHC.Utils.Binary
import GHC.Driver.Session
+import GHC.Driver.Env
+
+import GHC.Utils.Binary
import GHC.Unit.Module
import GHC.Types.Name
import GHC.Types.SafeHaskell
@@ -29,12 +31,13 @@ import System.FilePath (normalise)
-- NB: The 'Module' parameter is the 'Module' recorded by the
-- *interface* file, not the actual 'Module' according to our
-- 'DynFlags'.
-fingerprintDynFlags :: DynFlags -> Module
+fingerprintDynFlags :: HscEnv -> Module
-> (BinHandle -> Name -> IO ())
-> IO Fingerprint
-fingerprintDynFlags dflags@DynFlags{..} this_mod nameio =
- let mainis = if mainModIs dflags == this_mod then Just mainFunIs else Nothing
+fingerprintDynFlags hsc_env this_mod nameio =
+ let dflags@DynFlags{..} = hsc_dflags hsc_env
+ mainis = if mainModIs hsc_env == this_mod then Just mainFunIs else Nothing
-- see #5878
-- pkgopts = (homeUnit home_unit, sort $ packageFlags dflags)
safeHs = setSafeMode safeHaskell