diff options
Diffstat (limited to 'compiler/GHC/Stg/Lint.hs')
-rw-r--r-- | compiler/GHC/Stg/Lint.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs index 1e12e9bab9..8464cb8786 100644 --- a/compiler/GHC/Stg/Lint.hs +++ b/compiler/GHC/Stg/Lint.hs @@ -42,6 +42,7 @@ import GHC.Prelude import GHC.Stg.Syntax import GHC.Driver.Session +import GHC.Core.Lint ( interactiveInScope ) import GHC.Data.Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList ) import GHC.Types.Basic ( TopLevelFlag(..), isTopLevel ) import GHC.Types.CostCentre ( isCurrentCCS ) @@ -57,6 +58,7 @@ import GHC.Types.SrcLoc import GHC.Utils.Logger import GHC.Utils.Outputable import GHC.Unit.Module ( Module ) +import GHC.Runtime.Context ( InteractiveContext ) import qualified GHC.Utils.Error as Err import Control.Applicative ((<|>)) import Control.Monad @@ -64,13 +66,14 @@ import Control.Monad lintStgTopBindings :: forall a . (OutputablePass a, BinderP a ~ Id) => Logger -> DynFlags + -> InteractiveContext -> Module -- ^ module being compiled -> Bool -- ^ have we run Unarise yet? -> String -- ^ who produced the STG? -> [GenStgTopBinding a] -> IO () -lintStgTopBindings logger dflags this_mod unarised whodunnit binds +lintStgTopBindings logger dflags ictxt this_mod unarised whodunnit binds = {-# SCC "StgLint" #-} case initL this_mod unarised opts top_level_binds (lint_binds binds) of Nothing -> @@ -89,7 +92,8 @@ lintStgTopBindings logger dflags this_mod unarised whodunnit binds opts = initStgPprOpts dflags -- Bring all top-level binds into scope because CoreToStg does not generate -- bindings in dependency order (so we may see a use before its definition). - top_level_binds = mkVarSet (bindersOfTopBinds binds) + top_level_binds = extendVarSetList (mkVarSet (bindersOfTopBinds binds)) + (interactiveInScope ictxt) lint_binds :: [GenStgTopBinding a] -> LintM () |