diff options
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 024ac97c05..a1075f1cdb 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -39,7 +39,7 @@ module GHC.Driver.Session ( DynamicTooState(..), dynamicTooState, setDynamicNow, setDynamicTooFailed, dynamicOutputFile, sccProfilingEnabled, - DynFlags(..), mainModIs, + DynFlags(..), outputFile, hiSuf, objectSuf, ways, FlagSpec(..), HasDynFlags(..), ContainsDynFlags(..), @@ -63,8 +63,6 @@ module GHC.Driver.Session ( targetProfile, - mkHomeUnitFromFlags, - -- ** Log output putLogMsg, @@ -231,13 +229,11 @@ import GHC.Platform import GHC.Platform.Ways import GHC.Platform.Profile import GHC.UniqueSubdir (uniqueSubdir) -import GHC.Unit.Home import GHC.Unit.Types import GHC.Unit.Parser import GHC.Unit.Module import GHC.Builtin.Names ( mAIN_NAME ) import {-# SOURCE #-} GHC.Driver.Hooks -import {-# SOURCE #-} GHC.Unit.State (UnitState, emptyUnitState, UnitDatabase) import GHC.Driver.Phases ( Phase(..), phaseInputExt ) import GHC.Driver.Flags import GHC.Driver.Backend @@ -594,21 +590,6 @@ data DynFlags = DynFlags { packageEnv :: Maybe FilePath, -- ^ Filepath to the package environment file (if overriding default) - unitDatabases :: Maybe [UnitDatabase UnitId], - -- ^ Stack of unit databases for the target platform. - -- - -- This field is populated by `initUnits`. - -- - -- 'Nothing' means the databases have never been read from disk. If - -- `initUnits` is called again, it doesn't reload the databases from - -- disk. - - unitState :: UnitState, - -- ^ Consolidated unit database built by 'initUnits' from the unit - -- databases in 'unitDatabases' and flags ('-ignore-package', etc.). - -- - -- It also contains mapping from module names to actual Modules. - -- Temporary files -- These have to be IORefs, because the defaultCleanupHandler needs to -- know what to clean when an exception happens @@ -1232,8 +1213,6 @@ defaultDynFlags mySettings llvmConfig = ignorePackageFlags = [], trustFlags = [], packageEnv = Nothing, - unitDatabases = Nothing, - unitState = emptyUnitState, targetWays_ = defaultWays mySettings, splitInfo = Nothing, @@ -1666,9 +1645,6 @@ lang_set dflags lang = extensionFlags = flattenExtensionFlags lang (extensions dflags) } -mainModIs :: DynFlags -> Module -mainModIs dflags = mkHomeModule (mkHomeUnitFromFlags dflags) (mainModuleNameIs dflags) - -- | Set the Haskell language standard to use setLanguage :: Language -> DynP () setLanguage l = upd (`lang_set` Just l) @@ -1815,28 +1791,6 @@ setOutputHi f d = d { outputHi = f} setJsonLogAction :: DynFlags -> DynFlags setJsonLogAction d = d { log_action = jsonLogAction } --- | Get home unit -mkHomeUnitFromFlags :: DynFlags -> HomeUnit -mkHomeUnitFromFlags dflags = - let !hu_id = homeUnitId_ dflags - !hu_instanceof = homeUnitInstanceOf_ dflags - !hu_instantiations = homeUnitInstantiations_ dflags - in case (hu_instanceof, hu_instantiations) of - (Nothing,[]) -> DefiniteHomeUnit hu_id Nothing - (Nothing, _) -> throwGhcException $ CmdLineError ("Use of -instantiated-with requires -this-component-id") - (Just _, []) -> throwGhcException $ CmdLineError ("Use of -this-component-id requires -instantiated-with") - (Just u, is) - -- detect fully indefinite units: all their instantiations are hole - -- modules and the home unit id is the same as the instantiating unit - -- id (see Note [About units] in GHC.Unit) - | all (isHoleModule . snd) is && u == hu_id - -> IndefiniteHomeUnit u is - -- otherwise it must be that we (fully) instantiate an indefinite unit - -- to make it definite. - -- TODO: error when the unit is partially instantiated?? - | otherwise - -> DefiniteHomeUnit hu_id (Just (u, is)) - parseUnitInsts :: String -> Instantiations parseUnitInsts str = case filter ((=="").snd) (readP_to_S parse str) of [(r, "")] -> r |