Commit 240f5bf6 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Modules: Driver (#13009)

submodule updates: nofib, haddock
parent be7068a6
......@@ -288,7 +288,7 @@ module GHC (
{-
ToDo:
* inline bits of HscMain here to simplify layering: hscTcExpr, hscStmt.
* inline bits of GHC.Driver.Main here to simplify layering: hscTcExpr, hscStmt.
-}
#include "HsVersions.h"
......@@ -302,15 +302,15 @@ import GHC.Runtime.Interpreter
import GHCi.RemoteTypes
import PprTyThing ( pprFamInst )
import HscMain
import GhcMake
import DriverPipeline ( compileOne' )
import GhcMonad
import GHC.Driver.Main
import GHC.Driver.Make
import GHC.Driver.Pipeline ( compileOne' )
import GHC.Driver.Monad
import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface )
import TcRnTypes
import Predicate
import Packages
import GHC.Driver.Packages
import NameSet
import RdrName
import GHC.Hs
......@@ -329,11 +329,11 @@ import FamInstEnv ( FamInst )
import SrcLoc
import CoreSyn
import GHC.Iface.Tidy
import DriverPhases ( Phase(..), isHaskellSrcFilename )
import Finder
import HscTypes
import CmdLineParser
import DynFlags hiding (WarnReason(..))
import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename )
import GHC.Driver.Finder
import GHC.Driver.Types
import GHC.Driver.CmdLine
import GHC.Driver.Session hiding (WarnReason(..))
import SysTools
import SysTools.BaseDir
import Annotations
......@@ -1364,7 +1364,7 @@ getModuleSourceAndFlags mod = do
-- | Return module source as token stream, including comments.
--
-- The module must be in the module graph and its source must be available.
-- Throws a 'HscTypes.SourceError' on parse error.
-- Throws a 'GHC.Driver.Types.SourceError' on parse error.
getTokenStream :: GhcMonad m => Module -> m [Located Token]
getTokenStream mod = do
(sourceFile, source, flags) <- getModuleSourceAndFlags mod
......
......@@ -23,7 +23,7 @@ import GHC.ByteCode.Types
import GHCi.RemoteTypes
import GHC.Runtime.Interpreter
import HscTypes
import GHC.Driver.Types
import Name
import NameSet
import Literal
......@@ -31,7 +31,7 @@ import TyCon
import FastString
import GHC.StgToCmm.Layout ( ArgRep(..) )
import GHC.Runtime.Heap.Layout
import DynFlags
import GHC.Driver.Session
import Outputable
import GHC.Platform
import Util
......
......@@ -13,8 +13,8 @@ import GhcPrelude
import GHC.ByteCode.Types
import GHC.Runtime.Interpreter
import DynFlags
import HscTypes
import GHC.Driver.Session
import GHC.Driver.Types
import Name ( Name, getName )
import NameEnv
import DataCon ( DataCon, dataConRepArgTys, dataConIdentity )
......
......@@ -27,7 +27,7 @@ import SizedSeq
import GHC.Runtime.Interpreter
import GHC.ByteCode.Types
import HscTypes
import GHC.Driver.Types
import Name
import NameEnv
import PrimOp
......
......@@ -118,7 +118,7 @@ import GhcPrelude
import IdInfo
import BasicTypes
import {-# SOURCE #-} GHC.Cmm.BlockId (BlockId, mkBlockId)
import Packages
import GHC.Driver.Packages
import Module
import Name
import Unique
......@@ -126,7 +126,7 @@ import PrimOp
import CostCentre
import Outputable
import FastString
import DynFlags
import GHC.Driver.Session
import GHC.Platform
import UniqSet
import Util
......
......@@ -12,7 +12,7 @@ import GHC.Runtime.Heap.Layout
import GHC.Cmm (Convention(..))
import GHC.Cmm.Ppr () -- For Outputable instances
import DynFlags
import GHC.Driver.Session
import GHC.Platform
import Outputable
......
......@@ -36,7 +36,7 @@ import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
import GHC.Cmm.MachOp
import GHC.Cmm.Type
import DynFlags
import GHC.Driver.Session
import Outputable (panic)
import Unique
......
......@@ -31,7 +31,7 @@ import GHC.Cmm.Switch (SwitchTargets)
import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Graph
import GHC.Cmm.Dataflow.Label
import DynFlags
import GHC.Driver.Session
import FastString
import ForeignCall
import OrdList
......
......@@ -46,7 +46,7 @@ import GHC.Cmm.Dataflow.Collections
import GHC.Platform
import Maybes
import DynFlags
import GHC.Driver.Session
import ErrUtils (withTimingSilent)
import Panic
import UniqSupply
......
......@@ -24,7 +24,7 @@ import Digraph
import GHC.Cmm.CLabel
import GHC.Cmm
import GHC.Cmm.Utils
import DynFlags
import GHC.Driver.Session
import Maybes
import Outputable
import GHC.Runtime.Heap.Layout
......
......@@ -29,7 +29,7 @@ import Maybes
import UniqFM
import Util
import DynFlags
import GHC.Driver.Session
import FastString
import Outputable hiding ( isEmpty )
import qualified Data.Set as Set
......
......@@ -23,7 +23,7 @@ import GHC.Cmm.Liveness
import GHC.Cmm.Switch (switchTargetsToList)
import GHC.Cmm.Ppr () -- For Outputable instances
import Outputable
import DynFlags
import GHC.Driver.Session
import Control.Monad (ap)
......
......@@ -14,7 +14,7 @@ where
import GhcPrelude
import DynFlags
import GHC.Driver.Session
import GHC.Cmm.BlockId
import GHC.Cmm
import GHC.Cmm.Ppr.Expr () -- For Outputable instances
......
......@@ -32,7 +32,7 @@ import GhcPrelude
import GHC.Cmm.Type
import Outputable
import DynFlags
import GHC.Driver.Session
-----------------------------------------------------------------------------
-- MachOp
......
......@@ -17,7 +17,7 @@ import GhcPrelude
import Control.Monad
import DynFlags
import GHC.Driver.Session
import Lexer
newtype PD a = PD { unPD :: DynFlags -> PState -> ParseResult a }
......
......@@ -31,7 +31,7 @@ import GhcPrelude hiding (succ)
import GHC.Platform.Regs
import GHC.Cmm.Expr
import GHC.Cmm.Switch
import DynFlags
import GHC.Driver.Session
import FastString
import ForeignCall
import Outputable
......
......@@ -17,7 +17,7 @@ import GhcPrelude
import GHC.Cmm.Utils
import GHC.Cmm
import DynFlags
import GHC.Driver.Session
import Util
import Outputable
......
......@@ -242,7 +242,7 @@ import Literal
import Unique
import UniqFM
import SrcLoc
import DynFlags
import GHC.Driver.Session
import ErrUtils
import StringBuffer
import FastString
......
......@@ -23,9 +23,9 @@ import GHC.Cmm.Sink
import GHC.Cmm.Dataflow.Collections
import UniqSupply
import DynFlags
import GHC.Driver.Session
import ErrUtils
import HscTypes
import GHC.Driver.Types
import Control.Monad
import Outputable
import GHC.Platform
......
......@@ -43,7 +43,7 @@ import GhcPrelude
import GHC.Cmm.Ppr.Expr
import GHC.Cmm
import DynFlags
import GHC.Driver.Session
import Outputable
import FastString
......
......@@ -11,7 +11,7 @@ where
import GhcPrelude hiding (last, unzip, succ, zip)
import DynFlags
import GHC.Driver.Session
import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
import GHC.Cmm
......
......@@ -16,7 +16,7 @@ import GHC.Cmm.Dataflow.Graph
import GHC.Platform.Regs
import GHC.Platform (isARM, platformArch)
import DynFlags
import GHC.Driver.Session
import Unique
import UniqFM
......
......@@ -15,7 +15,7 @@ module GHC.Cmm.Switch (
import GhcPrelude
import Outputable
import DynFlags
import GHC.Driver.Session
import GHC.Cmm.Dataflow.Label (Label)
import Data.Maybe
......
......@@ -12,7 +12,7 @@ import GHC.Cmm
import GHC.Cmm.Utils
import GHC.Cmm.Switch
import UniqSupply
import DynFlags
import GHC.Driver.Session
import MonadUtils (concatMapM)
--
......
......@@ -31,7 +31,7 @@ where
import GhcPrelude
import DynFlags
import GHC.Driver.Session
import FastString
import Outputable
......
......@@ -80,7 +80,7 @@ import GHC.Cmm
import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
import Outputable
import DynFlags
import GHC.Driver.Session
import Unique
import GHC.Platform.Regs
......
......@@ -40,7 +40,7 @@ import GHC.Cmm.Switch
-- Utils
import CPrim
import DynFlags
import GHC.Driver.Session
import FastString
import Outputable
import GHC.Platform
......
......@@ -29,7 +29,7 @@ import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Ppr
import BufWrite
import DynFlags
import GHC.Driver.Session
import GHC.Platform ( platformArch, Arch(..) )
import ErrUtils
import FastString
......
......@@ -48,7 +48,7 @@ import GHC.CmmToLlvm.Regs
import GHC.Cmm.CLabel
import GHC.Platform.Regs ( activeStgRegs )
import DynFlags
import GHC.Driver.Session
import FastString
import GHC.Cmm hiding ( succ )
import GHC.Cmm.Utils (regsOverlap)
......
......@@ -25,7 +25,7 @@ import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Graph
import GHC.Cmm.Dataflow.Collections
import DynFlags
import GHC.Driver.Session
import FastString
import ForeignCall
import Outputable hiding (panic, pprPanic)
......
......@@ -17,7 +17,7 @@ import GHC.CmmToLlvm.Base
import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
import GHC.Cmm
import DynFlags
import GHC.Driver.Session
import GHC.Platform
import FastString
......
......@@ -13,7 +13,7 @@ module GHC.CmmToLlvm.Mangler ( llvmFixupAsm ) where
import GhcPrelude
import DynFlags ( DynFlags, targetPlatform )
import GHC.Driver.Session ( DynFlags, targetPlatform )
import GHC.Platform ( platformArch, Arch(..) )
import ErrUtils ( withTiming )
import Outputable ( text )
......
......@@ -16,7 +16,7 @@ import GhcPrelude
import GHC.Llvm
import GHC.Cmm.Expr
import DynFlags
import GHC.Driver.Session
import FastString
import Outputable ( panic )
import Unique
......
......@@ -22,7 +22,7 @@ import GHC.Runtime.Interpreter
import GHCi.FFI
import GHCi.RemoteTypes
import BasicTypes
import DynFlags
import GHC.Driver.Session
import Outputable
import GHC.Platform
import Name
......@@ -30,7 +30,7 @@ import MkId
import Id
import Var ( updateVarType )
import ForeignCall
import HscTypes
import GHC.Driver.Types
import CoreUtils
import CoreSyn
import PprCore
......
......@@ -41,7 +41,7 @@ import Outputable
import MonadUtils
import FastString
import Util
import DynFlags
import GHC.Driver.Session
import ForeignCall
import Demand ( isUsedOnce )
import PrimOp ( PrimCall(..), primOpWrapperId )
......
......@@ -21,7 +21,7 @@ import GhcPrelude
import OccurAnal
import HscTypes
import GHC.Driver.Types
import PrelNames
import MkId ( realWorldPrimId )
import CoreUtils
......@@ -50,7 +50,7 @@ import UniqSupply
import Maybes
import OrdList
import ErrUtils
import DynFlags
import GHC.Driver.Session
import Util
import Outputable
import FastString
......
......@@ -18,7 +18,7 @@ module GHC.Data.Bitmap (
import GhcPrelude
import GHC.Runtime.Heap.Layout
import DynFlags
import GHC.Driver.Session
import Util
import Data.Bits
......
......@@ -14,42 +14,42 @@
-- it builds and doesn't serialize out the database contents.
-- But it's still handy for constructing tests.
module DriverBkp (doBackpack) where
module GHC.Driver.Backpack (doBackpack) where
#include "HsVersions.h"
import GhcPrelude
-- In a separate module because it hooks into the parser.
import BkpSyn
import GHC.Driver.Backpack.Syntax
import ApiAnnotation
import GHC hiding (Failed, Succeeded)
import Packages
import GHC.Driver.Packages
import Parser
import Lexer
import GhcMonad
import DynFlags
import GHC.Driver.Monad
import GHC.Driver.Session
import TcRnMonad
import TcRnDriver
import Module
import HscTypes
import GHC.Driver.Types
import StringBuffer
import FastString
import ErrUtils
import SrcLoc
import HscMain
import GHC.Driver.Main
import UniqFM
import UniqDFM
import Outputable
import Maybes
import HeaderInfo
import GHC.Iface.Utils
import GhcMake
import GHC.Driver.Make
import UniqDSet
import PrelNames
import BasicTypes hiding (SuccessFlag(..))
import Finder
import GHC.Driver.Finder
import Util
import qualified GHC.LanguageExtensions as LangExt
......@@ -75,7 +75,7 @@ doBackpack [src_filename] = do
src_opts <- liftIO $ getOptionsFromFile dflags1 src_filename
(dflags, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags1 src_opts
modifySession (\hsc_env -> hsc_env {hsc_dflags = dflags})
-- Cribbed from: preprocessFile / DriverPipeline
-- Cribbed from: preprocessFile / GHC.Driver.Pipeline
liftIO $ checkProcessArgsResult dflags unhandled_flags
liftIO $ handleFlagWarnings dflags warns
-- TODO: Preprocessing not implemented
......@@ -264,7 +264,7 @@ buildUnit session cid insts lunit = do
-- Build dependencies OR make sure they make sense. BUT NOTE,
-- we can only check the ones that are fully filled; the rest
-- we have to defer until we've typechecked our local signature.
-- TODO: work this into GhcMake!!
-- TODO: work this into GHC.Driver.Make!!
forM_ (zip [1..] deps0) $ \(i, dep) ->
case session of
TcSession -> return ()
......@@ -629,14 +629,14 @@ convertHsModuleId (HsModuleId (L _ hsuid) (L _ modname)) = mkModule (convertHsUn
************************************************************************
-}
-- | This is our version of GhcMake.downsweep, but with a few modifications:
-- | This is our version of GHC.Driver.Make.downsweep, but with a few modifications:
--
-- 1. Every module is required to be mentioned, so we don't do any funny
-- business with targets or recursively grabbing dependencies. (We
-- could support this in principle).
-- 2. We support inline modules, whose summary we have to synthesize ourself.
--
-- We don't bother trying to support GhcMake for now, it's more trouble
-- We don't bother trying to support GHC.Driver.Make for now, it's more trouble
-- than it's worth for inline modules.
hsunitModuleGraph :: DynFlags -> HsUnit HsComponentId -> BkpM ModuleGraph
hsunitModuleGraph dflags unit = do
......@@ -747,7 +747,7 @@ hsModuleToModSummary pn hsc_src modname
let imps = hsmodImports (unLoc hsmod)
loc = getLoc hsmod
hsc_env <- getSession
-- Sort of the same deal as in DriverPipeline's getLocation
-- Sort of the same deal as in GHC.Driver.Pipeline's getLocation
-- Use the PACKAGE NAME to find the location
let PackageName unit_fs = pn
dflags = hsc_dflags hsc_env
......@@ -768,7 +768,7 @@ hsModuleToModSummary pn hsc_src modname
let location = case hsc_src of
HsBootFile -> addBootSuffixLocnOut location0
_ -> location0
-- This duplicates a pile of logic in GhcMake
-- This duplicates a pile of logic in GHC.Driver.Make
env <- getBkpEnv
time <- liftIO $ getModificationUTCTime (bkp_filename env)
hi_timestamp <- liftIO $ modificationTimeIfExists (ml_hi_file location)
......
-- | This is the syntax for bkp files which are parsed in 'ghc --backpack'
-- mode. This syntax is used purely for testing purposes.
module BkpSyn (
module GHC.Driver.Backpack.Syntax (
-- * Backpack abstract syntax
HsUnitId(..),
LHsUnitId,
......@@ -18,7 +18,7 @@ module BkpSyn (
import GhcPrelude
import DriverPhases
import GHC.Driver.Phases
import GHC.Hs
import SrcLoc
import Outputable
......
......@@ -11,7 +11,7 @@
--
-------------------------------------------------------------------------------
module CmdLineParser
module GHC.Driver.CmdLine
(
processArgs, OptKind(..), GhcFlagMode(..),
CmdLineP(..), getCmdLineState, putCmdLineState,
......
......@@ -6,7 +6,7 @@
{-# LANGUAGE CPP #-}
module CodeOutput( codeOutput, outputForeignStubs ) where
module GHC.Driver.CodeOutput ( codeOutput, outputForeignStubs ) where
#include "HsVersions.h"
......@@ -17,13 +17,13 @@ import GHC.CmmToLlvm ( llvmCodeGen )