\begin{code}
module HscTypes (
HscEnv(..), hscEPS,
- GhciMode(..), isOneShot,
ModDetails(..),
ModGuts(..), ModImports(..), ForeignStubs(..),
import TyCon ( TyCon, tyConSelIds, tyConDataCons )
import DataCon ( dataConImplicitIds )
import Packages ( PackageIdH, PackageId )
-import CmdLineOpts ( DynFlags )
+import DynFlags ( DynFlags(..), isOneShot )
import DriverPhases ( HscSource(..), isHsBoot, hscSourceString )
import BasicTypes ( Version, initialVersion, IPName,
Fixity, defaultFixity, DeprecTxt )
\begin{code}
data HscEnv
- = HscEnv { hsc_mode :: GhciMode,
- hsc_dflags :: DynFlags,
+ = HscEnv { hsc_dflags :: DynFlags,
hsc_HPT :: HomePackageTable,
-- The home package table describes already-compiled
hscEPS hsc_env = readIORef (hsc_EPS hsc_env)
\end{code}
-The GhciMode is self-explanatory:
-
-\begin{code}
-data GhciMode = Batch -- ghc --make Main
- | Interactive -- ghc --interactive
- | OneShot -- ghc Foo.hs
- | IDE -- Visual Studio etc
- deriving Eq
-
-isOneShot :: GhciMode -> Bool
-isOneShot OneShot = True
-isOneShot _other = False
-\end{code}
-
\begin{code}
type HomePackageTable = ModuleEnv HomeModInfo -- Domain = modules in the home package
type PackageIfaceTable = ModuleEnv ModIface -- Domain = modules in the imported packages
-- Get rules from modules "below" this one (in the dependency sense)
-- C.f Inst.hptInstances
hptRules hsc_env deps
- | isOneShot (hsc_mode hsc_env) = []
+ | isOneShot (ghcMode (hsc_dflags hsc_env)) = []
| otherwise
= let
hpt = hsc_HPT hsc_env