summaryrefslogtreecommitdiff
path: root/compiler/GHC/Runtime/Context.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/Runtime/Context.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/Runtime/Context.hs')
-rw-r--r--compiler/GHC/Runtime/Context.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/Runtime/Context.hs b/compiler/GHC/Runtime/Context.hs
index 932e499e47..a69e358e32 100644
--- a/compiler/GHC/Runtime/Context.hs
+++ b/compiler/GHC/Runtime/Context.hs
@@ -23,6 +23,7 @@ import {-# SOURCE #-} GHC.Driver.Plugins
import GHC.Runtime.Eval.Types ( Resume )
import GHC.Unit
+import GHC.Unit.Env
import GHC.Core.FamInstEnv
import GHC.Core.InstEnv ( ClsInst, identicalClsInstHead )
@@ -289,9 +290,9 @@ icInScopeTTs :: InteractiveContext -> [TyThing]
icInScopeTTs = ic_tythings
-- | Get the PrintUnqualified function based on the flags and this InteractiveContext
-icPrintUnqual :: UnitState -> HomeUnit -> InteractiveContext -> PrintUnqualified
-icPrintUnqual unit_state home_unit InteractiveContext{ ic_rn_gbl_env = grenv } =
- mkPrintUnqualified unit_state home_unit grenv
+icPrintUnqual :: UnitEnv -> InteractiveContext -> PrintUnqualified
+icPrintUnqual unit_env InteractiveContext{ ic_rn_gbl_env = grenv } =
+ mkPrintUnqualified unit_env grenv
-- | extendInteractiveContext is called with new TyThings recently defined to update the
-- InteractiveContext to include them. Ids are easily removed when shadowed,