{-# OPTIONS_GHC -O0 #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module GHC.Driver.Session (
DumpFlag(..),
GeneralFlag(..),
WarningFlag(..), DiagnosticReason(..),
Language(..),
FatalMessager, FlushOut(..),
ProfAuto(..),
glasgowExtsFlags,
hasPprDebug, hasNoDebugOutput, hasNoStateHack, hasNoOptCoercion,
dopt, dopt_set, dopt_unset,
gopt, gopt_set, gopt_unset, setGeneralFlag', unSetGeneralFlag',
wopt, wopt_set, wopt_unset,
wopt_fatal, wopt_set_fatal, wopt_unset_fatal,
xopt, xopt_set, xopt_unset,
xopt_set_unlessExplSpec,
xopt_DuplicateRecordFields,
xopt_FieldSelectors,
lang_set,
DynamicTooState(..), dynamicTooState, setDynamicNow,
sccProfilingEnabled,
needSourceNotes,
DynFlags(..),
outputFile, objectSuf, ways,
FlagSpec(..),
HasDynFlags(..), ContainsDynFlags(..),
RtsOptsEnabled(..),
GhcMode(..), isOneShot,
GhcLink(..), isNoLink,
PackageFlag(..), PackageArg(..), ModRenaming(..),
packageFlagsChanged,
IgnorePackageFlag(..), TrustFlag(..),
PackageDBFlag(..), PkgDbRef(..),
Option(..), showOpt,
DynLibLoader(..),
fFlags, fLangFlags, xFlags,
wWarningFlags,
makeDynFlagsConsistent,
positionIndependent,
optimisationFlags,
setFlagsFromEnvFile,
pprDynFlagsDiff,
flagSpecOf,
targetProfile,
safeHaskellOn, safeHaskellModeEnabled,
safeImportsOn, safeLanguageOn, safeInferOn,
packageTrustOn,
safeDirectImpsReq, safeImplicitImpsReq,
unsafeFlags, unsafeFlagsForInfer,
LlvmTarget(..), LlvmConfig(..),
Settings(..),
sProgramName,
sProjectVersion,
sGhcUsagePath,
sGhciUsagePath,
sToolDir,
sTopDir,
sGlobalPackageDatabasePath,
sLdSupportsCompactUnwind,
sLdSupportsBuildId,
sLdSupportsFilelist,
sLdIsGnuLd,
sGccSupportsNoPie,
sPgm_L,
sPgm_P,
sPgm_F,
sPgm_c,
sPgm_a,
sPgm_l,
sPgm_lm,
sPgm_dll,
sPgm_T,
sPgm_windres,
sPgm_ar,
sPgm_ranlib,
sPgm_lo,
sPgm_lc,
sPgm_lcc,
sPgm_i,
sOpt_L,
sOpt_P,
sOpt_P_fingerprint,
sOpt_F,
sOpt_c,
sOpt_cxx,
sOpt_a,
sOpt_l,
sOpt_lm,
sOpt_windres,
sOpt_lo,
sOpt_lc,
sOpt_lcc,
sOpt_i,
sExtraGccViaCFlags,
sTargetPlatformString,
sGhcWithInterpreter,
sLibFFI,
GhcNameVersion(..),
FileSettings(..),
PlatformMisc(..),
settings,
programName, projectVersion,
ghcUsagePath, ghciUsagePath, topDir,
versionedAppDir, versionedFilePath,
extraGccViaCFlags, globalPackageDatabasePath,
pgm_L, pgm_P, pgm_F, pgm_c, pgm_a, pgm_l, pgm_lm, pgm_dll, pgm_T,
pgm_windres, pgm_ar, pgm_otool, pgm_install_name_tool,
pgm_ranlib, pgm_lo, pgm_lc, pgm_lcc, pgm_i,
opt_L, opt_P, opt_F, opt_c, opt_cxx, opt_a, opt_l, opt_lm, opt_i,
opt_P_signature,
opt_windres, opt_lo, opt_lc, opt_lcc,
updatePlatformConstants,
addPluginModuleName,
defaultDynFlags,
initDynFlags,
defaultFatalMessager,
defaultFlushOut,
setOutputFile, setDynOutputFile, setOutputHi, setDynOutputHi,
augmentByWorkingDirectory,
getOpts,
getVerbFlags,
updOptLevel,
setTmpDir,
setUnitId,
TurnOnFlag,
turnOn,
turnOff,
impliedGFlags,
impliedOffGFlags,
impliedXFlags,
CmdLineP(..), runCmdLineP,
getCmdLineState, putCmdLineState,
processCmdLineP,
parseDynamicFlagsCmdLine,
parseDynamicFilePragma,
parseDynamicFlagsFull,
allNonDeprecatedFlags,
flagsAll,
flagsDynamic,
flagsPackage,
flagsForCompletion,
supportedLanguagesAndExtensions,
languageExtensions,
picCCOpts, picPOpts,
pieCCLDOpts,
compilerInfo,
wordAlignment,
setUnsafeGlobalDynFlags,
isSse4_2Enabled,
isBmiEnabled,
isBmi2Enabled,
isAvxEnabled,
isAvx2Enabled,
isAvx512cdEnabled,
isAvx512erEnabled,
isAvx512fEnabled,
isAvx512pfEnabled,
LinkerInfo(..),
CompilerInfo(..),
useXLinkerRPath,
IncludeSpecs(..), addGlobalInclude, addQuoteInclude, flattenIncludes,
addImplicitQuoteInclude,
initSDocContext, initDefaultSDocContext,
) where
import GHC.Prelude
import GHC.Platform
import GHC.Platform.Ways
import GHC.Platform.Profile
import GHC.UniqueSubdir (uniqueSubdir)
import GHC.Unit.Types
import GHC.Unit.Parser
import GHC.Unit.Module
import GHC.Builtin.Names ( mAIN_NAME )
import GHC.Driver.Phases ( Phase(..), phaseInputExt )
import GHC.Driver.Flags
import GHC.Driver.Backend
import GHC.Settings.Config
import GHC.Utils.CliOption
import GHC.Core.Unfold
import GHC.Driver.CmdLine
import GHC.Settings.Constants
import GHC.Utils.Panic
import qualified GHC.Utils.Ppr.Colour as Col
import GHC.Utils.Misc
import GHC.Utils.Constants (debugIsOn)
import GHC.Utils.GlobalVars
import GHC.Data.Maybe
import GHC.Data.Bool
import GHC.Utils.Monad
import GHC.Types.Error (DiagnosticReason(..))
import GHC.Types.SrcLoc
import GHC.Types.SafeHaskell
import GHC.Types.Basic ( IntWithInf, treatZeroAsInf )
import qualified GHC.Types.FieldLabel as FieldLabel
import GHC.Data.FastString
import GHC.Utils.TmpFs
import GHC.Utils.Fingerprint
import GHC.Utils.Outputable
import GHC.Settings
import GHC.CmmToAsm.CFG.Weight
import {-# SOURCE #-} GHC.Core.Opt.CallerCC
import GHC.SysTools.Terminal ( stderrSupportsAnsiColors )
import GHC.SysTools.BaseDir ( expandToolDir, expandTopDir )
import Data.IORef
import Control.Arrow ((&&&))
import Control.Monad
import Control.Monad.Trans.Class
import Control.Monad.Trans.Writer
import Control.Monad.Trans.Reader
import Control.Monad.Trans.Except
import Control.Monad.Trans.State as State
import Data.Functor.Identity
import Data.Ord
import Data.Char
import Data.List (intercalate, sortBy)
import qualified Data.List.NonEmpty as NE
import qualified Data.Map as Map
import qualified Data.Set as Set
import System.FilePath
import System.Directory
import System.Environment (lookupEnv)
import System.IO
import System.IO.Error
import Text.ParserCombinators.ReadP hiding (char)
import Text.ParserCombinators.ReadP as R
import GHC.Data.EnumSet (EnumSet)
import qualified GHC.Data.EnumSet as EnumSet
import GHC.Foreign (withCString, peekCString)
import qualified GHC.LanguageExtensions as LangExt
data IncludeSpecs
= IncludeSpecs { IncludeSpecs -> [String]
includePathsQuote :: [String]
, IncludeSpecs -> [String]
includePathsGlobal :: [String]
, IncludeSpecs -> [String]
includePathsQuoteImplicit :: [String]
}
deriving Int -> IncludeSpecs -> ShowS
[IncludeSpecs] -> ShowS
IncludeSpecs -> String
(Int -> IncludeSpecs -> ShowS)
-> (IncludeSpecs -> String)
-> ([IncludeSpecs] -> ShowS)
-> Show IncludeSpecs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IncludeSpecs] -> ShowS
$cshowList :: [IncludeSpecs] -> ShowS
show :: IncludeSpecs -> String
$cshow :: IncludeSpecs -> String
showsPrec :: Int -> IncludeSpecs -> ShowS
$cshowsPrec :: Int -> IncludeSpecs -> ShowS
Show
addGlobalInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addGlobalInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addGlobalInclude IncludeSpecs
spec [String]
paths = let f :: [String]
f = IncludeSpecs -> [String]
includePathsGlobal IncludeSpecs
spec
in IncludeSpecs
spec { includePathsGlobal :: [String]
includePathsGlobal = [String]
f [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
paths }
addQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addQuoteInclude IncludeSpecs
spec [String]
paths = let f :: [String]
f = IncludeSpecs -> [String]
includePathsQuote IncludeSpecs
spec
in IncludeSpecs
spec { includePathsQuote :: [String]
includePathsQuote = [String]
f [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
paths }
addImplicitQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addImplicitQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addImplicitQuoteInclude IncludeSpecs
spec [String]
paths = let f :: [String]
f = IncludeSpecs -> [String]
includePathsQuoteImplicit IncludeSpecs
spec
in IncludeSpecs
spec { includePathsQuoteImplicit :: [String]
includePathsQuoteImplicit = [String]
f [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
paths }
flattenIncludes :: IncludeSpecs -> [String]
flattenIncludes :: IncludeSpecs -> [String]
flattenIncludes IncludeSpecs
specs =
IncludeSpecs -> [String]
includePathsQuote IncludeSpecs
specs [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++
IncludeSpecs -> [String]
includePathsQuoteImplicit IncludeSpecs
specs [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++
IncludeSpecs -> [String]
includePathsGlobal IncludeSpecs
specs
data DynFlags = DynFlags {
DynFlags -> GhcMode
ghcMode :: GhcMode,
DynFlags -> GhcLink
ghcLink :: GhcLink,
DynFlags -> Backend
backend :: !Backend,
DynFlags -> GhcNameVersion
ghcNameVersion :: {-# UNPACK #-} !GhcNameVersion,
DynFlags -> FileSettings
fileSettings :: {-# UNPACK #-} !FileSettings,
DynFlags -> Platform
targetPlatform :: Platform,
DynFlags -> ToolSettings
toolSettings :: {-# UNPACK #-} !ToolSettings,
DynFlags -> PlatformMisc
platformMisc :: {-# UNPACK #-} !PlatformMisc,
DynFlags -> [(String, String)]
rawSettings :: [(String, String)],
DynFlags -> TempDir
tmpDir :: TempDir,
DynFlags -> LlvmConfig
llvmConfig :: LlvmConfig,
DynFlags -> Int
llvmOptLevel :: Int,
DynFlags -> Int
verbosity :: Int,
DynFlags -> Int
debugLevel :: Int,
DynFlags -> Int
simplPhases :: Int,
DynFlags -> Int
maxSimplIterations :: Int,
DynFlags -> Maybe String
ruleCheck :: Maybe String,
DynFlags -> [Int]
strictnessBefore :: [Int],
DynFlags -> Maybe Int
parMakeCount :: Maybe Int,
DynFlags -> Bool
enableTimeStats :: Bool,
DynFlags -> Maybe Int
ghcHeapSize :: Maybe Int,
DynFlags -> Maybe Int
maxRelevantBinds :: Maybe Int,
DynFlags -> Maybe Int
maxValidHoleFits :: Maybe Int,
DynFlags -> Maybe Int
maxRefHoleFits :: Maybe Int,
DynFlags -> Maybe Int
refLevelHoleFits :: Maybe Int,
DynFlags -> Int
maxUncoveredPatterns :: Int,
DynFlags -> Int
maxPmCheckModels :: Int,
DynFlags -> Int
simplTickFactor :: Int,
DynFlags -> Int
dmdUnboxWidth :: !Int,
DynFlags -> Maybe Int
specConstrThreshold :: Maybe Int,
DynFlags -> Maybe Int
specConstrCount :: Maybe Int,
DynFlags -> Int
specConstrRecursive :: Int,
DynFlags -> Maybe Word
binBlobThreshold :: Maybe Word,
DynFlags -> Maybe Int
liberateCaseThreshold :: Maybe Int,
DynFlags -> Maybe Int
floatLamArgs :: Maybe Int,
DynFlags -> Maybe Int
liftLamsRecArgs :: Maybe Int,
DynFlags -> Maybe Int
liftLamsNonRecArgs :: Maybe Int,
DynFlags -> Bool
liftLamsKnown :: Bool,
DynFlags -> Maybe Int
cmmProcAlignment :: Maybe Int,
DynFlags -> Int
historySize :: Int,
DynFlags -> [String]
importPaths :: [FilePath],
DynFlags -> ModuleName
mainModuleNameIs :: ModuleName,
DynFlags -> Maybe String
mainFunIs :: Maybe String,
DynFlags -> IntWithInf
reductionDepth :: IntWithInf,
DynFlags -> IntWithInf
solverIterations :: IntWithInf,
DynFlags -> UnitId
homeUnitId_ :: UnitId,
DynFlags -> Maybe UnitId
homeUnitInstanceOf_ :: Maybe UnitId,
DynFlags -> [(ModuleName, Module)]
homeUnitInstantiations_ :: [(ModuleName, Module)],
DynFlags -> Maybe String
workingDirectory :: Maybe FilePath,
DynFlags -> Maybe String
thisPackageName :: Maybe String,
DynFlags -> Set ModuleName
hiddenModules :: Set.Set ModuleName,
DynFlags -> Set ModuleName
reexportedModules :: Set.Set ModuleName,
DynFlags -> Ways
targetWays_ :: Ways,
DynFlags -> Maybe (String, Int)
splitInfo :: Maybe (String,Int),
DynFlags -> Maybe String
objectDir :: Maybe String,
DynFlags -> Maybe String
dylibInstallName :: Maybe String,
DynFlags -> Maybe String
hiDir :: Maybe String,
DynFlags -> Maybe String
hieDir :: Maybe String,
DynFlags -> Maybe String
stubDir :: Maybe String,
DynFlags -> Maybe String
dumpDir :: Maybe String,
DynFlags -> String
objectSuf_ :: String,
DynFlags -> String
hcSuf :: String,
DynFlags -> String
hiSuf_ :: String,
DynFlags -> String
hieSuf :: String,
DynFlags -> String
dynObjectSuf_ :: String,
DynFlags -> String
dynHiSuf_ :: String,
DynFlags -> Maybe String
outputFile_ :: Maybe String,
DynFlags -> Maybe String
dynOutputFile_ :: Maybe String,
DynFlags -> Maybe String
outputHi :: Maybe String,
DynFlags -> Maybe String
dynOutputHi :: Maybe String,
DynFlags -> DynLibLoader
dynLibLoader :: DynLibLoader,
DynFlags -> Bool
dynamicNow :: !Bool,
DynFlags -> String
dumpPrefix :: FilePath,
DynFlags -> Maybe String
dumpPrefixForce :: Maybe FilePath,
DynFlags -> [Option]
ldInputs :: [Option],
DynFlags -> IncludeSpecs
includePaths :: IncludeSpecs,
DynFlags -> [String]
libraryPaths :: [String],
DynFlags -> [String]
frameworkPaths :: [String],
DynFlags -> [String]
cmdlineFrameworks :: [String],
DynFlags -> Maybe String
rtsOpts :: Maybe String,
DynFlags -> RtsOptsEnabled
rtsOptsEnabled :: RtsOptsEnabled,
DynFlags -> Bool
rtsOptsSuggestions :: Bool,
DynFlags -> String
hpcDir :: String,
DynFlags -> [ModuleName]
pluginModNames :: [ModuleName],
DynFlags -> [(ModuleName, String)]
pluginModNameOpts :: [(ModuleName,String)],
DynFlags -> [String]
frontendPluginOpts :: [String],
DynFlags -> String
depMakefile :: FilePath,
DynFlags -> Bool
depIncludePkgDeps :: Bool,
DynFlags -> Bool
depIncludeCppDeps :: Bool,
DynFlags -> [ModuleName]
depExcludeMods :: [ModuleName],
DynFlags -> [String]
depSuffixes :: [String],
DynFlags -> [PackageDBFlag]
packageDBFlags :: [PackageDBFlag],
DynFlags -> [IgnorePackageFlag]
ignorePackageFlags :: [IgnorePackageFlag],
DynFlags -> [PackageFlag]
packageFlags :: [PackageFlag],
DynFlags -> [PackageFlag]
pluginPackageFlags :: [PackageFlag],
DynFlags -> [TrustFlag]
trustFlags :: [TrustFlag],
DynFlags -> Maybe String
packageEnv :: Maybe FilePath,
DynFlags -> EnumSet DumpFlag
dumpFlags :: EnumSet DumpFlag,
DynFlags -> EnumSet GeneralFlag
generalFlags :: EnumSet GeneralFlag,
DynFlags -> EnumSet WarningFlag
warningFlags :: EnumSet WarningFlag,
DynFlags -> EnumSet WarningFlag
fatalWarningFlags :: EnumSet WarningFlag,
DynFlags -> Maybe Language
language :: Maybe Language,
DynFlags -> SafeHaskellMode
safeHaskell :: SafeHaskellMode,
DynFlags -> Bool
safeInfer :: Bool,
DynFlags -> Bool
safeInferred :: Bool,
DynFlags -> SrcSpan
thOnLoc :: SrcSpan,
DynFlags -> SrcSpan
newDerivOnLoc :: SrcSpan,
DynFlags -> SrcSpan
deriveViaOnLoc :: SrcSpan,
DynFlags -> SrcSpan
overlapInstLoc :: SrcSpan,
DynFlags -> SrcSpan
incoherentOnLoc :: SrcSpan,
DynFlags -> SrcSpan
pkgTrustOnLoc :: SrcSpan,
DynFlags -> SrcSpan
warnSafeOnLoc :: SrcSpan,
DynFlags -> SrcSpan
warnUnsafeOnLoc :: SrcSpan,
DynFlags -> SrcSpan
trustworthyOnLoc :: SrcSpan,
DynFlags -> [OnOff Extension]
extensions :: [OnOff LangExt.Extension],
DynFlags -> EnumSet Extension
extensionFlags :: EnumSet LangExt.Extension,
DynFlags -> UnfoldingOpts
unfoldingOpts :: !UnfoldingOpts,
DynFlags -> Int
maxWorkerArgs :: Int,
DynFlags -> Int
ghciHistSize :: Int,
DynFlags -> FlushOut
flushOut :: FlushOut,
DynFlags -> Maybe String
ghcVersionFile :: Maybe FilePath,
DynFlags -> Maybe String
haddockOptions :: Maybe String,
DynFlags -> [String]
ghciScripts :: [String],
DynFlags -> Int
pprUserLength :: Int,
DynFlags -> Int
pprCols :: Int,
DynFlags -> Bool
useUnicode :: Bool,
DynFlags -> OverridingBool
useColor :: OverridingBool,
DynFlags -> Bool
canUseColor :: Bool,
DynFlags -> Scheme
colScheme :: Col.Scheme,
DynFlags -> ProfAuto
profAuto :: ProfAuto,
DynFlags -> [CallerCcFilter]
callerCcFilters :: [CallerCcFilter],
DynFlags -> Maybe String
interactivePrint :: Maybe String,
DynFlags -> Maybe SseVersion
sseVersion :: Maybe SseVersion,
DynFlags -> Maybe BmiVersion
bmiVersion :: Maybe BmiVersion,
DynFlags -> Bool
avx :: Bool,
DynFlags -> Bool
avx2 :: Bool,
DynFlags -> Bool
avx512cd :: Bool,
DynFlags -> Bool
avx512er :: Bool,
DynFlags -> Bool
avx512f :: Bool,
DynFlags -> Bool
avx512pf :: Bool,
DynFlags -> IORef (Maybe LinkerInfo)
rtldInfo :: IORef (Maybe LinkerInfo),
DynFlags -> IORef (Maybe CompilerInfo)
rtccInfo :: IORef (Maybe CompilerInfo),
DynFlags -> IORef (Maybe CompilerInfo)
rtasmInfo :: IORef (Maybe CompilerInfo),
DynFlags -> Int
maxInlineAllocSize :: Int,
DynFlags -> Int
maxInlineMemcpyInsns :: Int,
DynFlags -> Int
maxInlineMemsetInsns :: Int,
DynFlags -> Bool
reverseErrors :: Bool,
DynFlags -> Maybe Int
maxErrors :: Maybe Int,
DynFlags -> Word
initialUnique :: Word,
DynFlags -> Int
uniqueIncrement :: Int,
DynFlags -> Weights
cfgWeights :: Weights
}
class HasDynFlags m where
getDynFlags :: m DynFlags
instance (Monoid a, Monad m, HasDynFlags m) => HasDynFlags (WriterT a m) where
getDynFlags :: WriterT a m DynFlags
getDynFlags = m DynFlags -> WriterT a m DynFlags
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m DynFlags
forall (m :: * -> *). HasDynFlags m => m DynFlags
getDynFlags
instance (Monad m, HasDynFlags m) => HasDynFlags (ReaderT a m) where
getDynFlags :: ReaderT a m DynFlags
getDynFlags = m DynFlags -> ReaderT a m DynFlags
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m DynFlags
forall (m :: * -> *). HasDynFlags m => m DynFlags
getDynFlags
instance (Monad m, HasDynFlags m) => HasDynFlags (MaybeT m) where
getDynFlags :: MaybeT m DynFlags
getDynFlags = m DynFlags -> MaybeT m DynFlags
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m DynFlags
forall (m :: * -> *). HasDynFlags m => m DynFlags
getDynFlags
instance (Monad m, HasDynFlags m) => HasDynFlags (ExceptT e m) where
getDynFlags :: ExceptT e m DynFlags
getDynFlags = m DynFlags -> ExceptT e m DynFlags
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m DynFlags
forall (m :: * -> *). HasDynFlags m => m DynFlags
getDynFlags
class ContainsDynFlags t where
:: t -> DynFlags
data ProfAuto
= NoProfAuto
| ProfAutoAll
| ProfAutoTop
| ProfAutoExports
| ProfAutoCalls
deriving (ProfAuto -> ProfAuto -> Bool
(ProfAuto -> ProfAuto -> Bool)
-> (ProfAuto -> ProfAuto -> Bool) -> Eq ProfAuto
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProfAuto -> ProfAuto -> Bool
$c/= :: ProfAuto -> ProfAuto -> Bool
== :: ProfAuto -> ProfAuto -> Bool
$c== :: ProfAuto -> ProfAuto -> Bool
Eq,Int -> ProfAuto
ProfAuto -> Int
ProfAuto -> [ProfAuto]
ProfAuto -> ProfAuto
ProfAuto -> ProfAuto -> [ProfAuto]
ProfAuto -> ProfAuto -> ProfAuto -> [ProfAuto]
(ProfAuto -> ProfAuto)
-> (ProfAuto -> ProfAuto)
-> (Int -> ProfAuto)
-> (ProfAuto -> Int)
-> (ProfAuto -> [ProfAuto])
-> (ProfAuto -> ProfAuto -> [ProfAuto])
-> (ProfAuto -> ProfAuto -> [ProfAuto])
-> (ProfAuto -> ProfAuto -> ProfAuto -> [ProfAuto])
-> Enum ProfAuto
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ProfAuto -> ProfAuto -> ProfAuto -> [ProfAuto]
$cenumFromThenTo :: ProfAuto -> ProfAuto -> ProfAuto -> [ProfAuto]
enumFromTo :: ProfAuto -> ProfAuto -> [ProfAuto]
$cenumFromTo :: ProfAuto -> ProfAuto -> [ProfAuto]
enumFromThen :: ProfAuto -> ProfAuto -> [ProfAuto]
$cenumFromThen :: ProfAuto -> ProfAuto -> [ProfAuto]
enumFrom :: ProfAuto -> [ProfAuto]
$cenumFrom :: ProfAuto -> [ProfAuto]
fromEnum :: ProfAuto -> Int
$cfromEnum :: ProfAuto -> Int
toEnum :: Int -> ProfAuto
$ctoEnum :: Int -> ProfAuto
pred :: ProfAuto -> ProfAuto
$cpred :: ProfAuto -> ProfAuto
succ :: ProfAuto -> ProfAuto
$csucc :: ProfAuto -> ProfAuto
Enum)
data LlvmTarget = LlvmTarget
{ LlvmTarget -> String
lDataLayout :: String
, LlvmTarget -> String
lCPU :: String
, LlvmTarget -> [String]
lAttributes :: [String]
}
data LlvmConfig = LlvmConfig { LlvmConfig -> [(String, LlvmTarget)]
llvmTargets :: [(String, LlvmTarget)]
, LlvmConfig -> [(Int, String)]
llvmPasses :: [(Int, String)]
}
settings :: DynFlags -> Settings
settings :: DynFlags -> Settings
settings DynFlags
dflags = Settings :: GhcNameVersion
-> FileSettings
-> Platform
-> ToolSettings
-> PlatformMisc
-> [(String, String)]
-> Settings
Settings
{ sGhcNameVersion :: GhcNameVersion
sGhcNameVersion = DynFlags -> GhcNameVersion
ghcNameVersion DynFlags
dflags
, sFileSettings :: FileSettings
sFileSettings = DynFlags -> FileSettings
fileSettings DynFlags
dflags
, sTargetPlatform :: Platform
sTargetPlatform = DynFlags -> Platform
targetPlatform DynFlags
dflags
, sToolSettings :: ToolSettings
sToolSettings = DynFlags -> ToolSettings
toolSettings DynFlags
dflags
, sPlatformMisc :: PlatformMisc
sPlatformMisc = DynFlags -> PlatformMisc
platformMisc DynFlags
dflags
, sRawSettings :: [(String, String)]
sRawSettings = DynFlags -> [(String, String)]
rawSettings DynFlags
dflags
}
programName :: DynFlags -> String
programName :: DynFlags -> String
programName DynFlags
dflags = GhcNameVersion -> String
ghcNameVersion_programName (GhcNameVersion -> String) -> GhcNameVersion -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> GhcNameVersion
ghcNameVersion DynFlags
dflags
projectVersion :: DynFlags -> String
projectVersion :: DynFlags -> String
projectVersion DynFlags
dflags = GhcNameVersion -> String
ghcNameVersion_projectVersion (DynFlags -> GhcNameVersion
ghcNameVersion DynFlags
dflags)
ghcUsagePath :: DynFlags -> FilePath
ghcUsagePath :: DynFlags -> String
ghcUsagePath DynFlags
dflags = FileSettings -> String
fileSettings_ghcUsagePath (FileSettings -> String) -> FileSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> FileSettings
fileSettings DynFlags
dflags
ghciUsagePath :: DynFlags -> FilePath
ghciUsagePath :: DynFlags -> String
ghciUsagePath DynFlags
dflags = FileSettings -> String
fileSettings_ghciUsagePath (FileSettings -> String) -> FileSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> FileSettings
fileSettings DynFlags
dflags
toolDir :: DynFlags -> Maybe FilePath
toolDir :: DynFlags -> Maybe String
toolDir DynFlags
dflags = FileSettings -> Maybe String
fileSettings_toolDir (FileSettings -> Maybe String) -> FileSettings -> Maybe String
forall a b. (a -> b) -> a -> b
$ DynFlags -> FileSettings
fileSettings DynFlags
dflags
topDir :: DynFlags -> FilePath
topDir :: DynFlags -> String
topDir DynFlags
dflags = FileSettings -> String
fileSettings_topDir (FileSettings -> String) -> FileSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> FileSettings
fileSettings DynFlags
dflags
extraGccViaCFlags :: DynFlags -> [String]
DynFlags
dflags = ToolSettings -> [String]
toolSettings_extraGccViaCFlags (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
globalPackageDatabasePath :: DynFlags -> FilePath
globalPackageDatabasePath :: DynFlags -> String
globalPackageDatabasePath DynFlags
dflags = FileSettings -> String
fileSettings_globalPackageDatabase (FileSettings -> String) -> FileSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> FileSettings
fileSettings DynFlags
dflags
pgm_L :: DynFlags -> String
pgm_L :: DynFlags -> String
pgm_L DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_L (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_P :: DynFlags -> (String,[Option])
pgm_P :: DynFlags -> (String, [Option])
pgm_P DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_P (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_F :: DynFlags -> String
pgm_F :: DynFlags -> String
pgm_F DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_F (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_c :: DynFlags -> String
pgm_c :: DynFlags -> String
pgm_c DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_c (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_a :: DynFlags -> (String,[Option])
pgm_a :: DynFlags -> (String, [Option])
pgm_a DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_a (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_l :: DynFlags -> (String,[Option])
pgm_l :: DynFlags -> (String, [Option])
pgm_l DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_l (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_lm :: DynFlags -> Maybe (String,[Option])
pgm_lm :: DynFlags -> Maybe (String, [Option])
pgm_lm DynFlags
dflags = ToolSettings -> Maybe (String, [Option])
toolSettings_pgm_lm (ToolSettings -> Maybe (String, [Option]))
-> ToolSettings -> Maybe (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_dll :: DynFlags -> (String,[Option])
pgm_dll :: DynFlags -> (String, [Option])
pgm_dll DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_dll (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_T :: DynFlags -> String
pgm_T :: DynFlags -> String
pgm_T DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_T (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_windres :: DynFlags -> String
pgm_windres :: DynFlags -> String
pgm_windres DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_windres (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_lcc :: DynFlags -> (String,[Option])
pgm_lcc :: DynFlags -> (String, [Option])
pgm_lcc DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_lcc (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_ar :: DynFlags -> String
pgm_ar :: DynFlags -> String
pgm_ar DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_ar (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_otool :: DynFlags -> String
pgm_otool :: DynFlags -> String
pgm_otool DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_otool (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_install_name_tool :: DynFlags -> String
pgm_install_name_tool :: DynFlags -> String
pgm_install_name_tool DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_install_name_tool (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_ranlib :: DynFlags -> String
pgm_ranlib :: DynFlags -> String
pgm_ranlib DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_ranlib (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_lo :: DynFlags -> (String,[Option])
pgm_lo :: DynFlags -> (String, [Option])
pgm_lo DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_lo (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_lc :: DynFlags -> (String,[Option])
pgm_lc :: DynFlags -> (String, [Option])
pgm_lc DynFlags
dflags = ToolSettings -> (String, [Option])
toolSettings_pgm_lc (ToolSettings -> (String, [Option]))
-> ToolSettings -> (String, [Option])
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
pgm_i :: DynFlags -> String
pgm_i :: DynFlags -> String
pgm_i DynFlags
dflags = ToolSettings -> String
toolSettings_pgm_i (ToolSettings -> String) -> ToolSettings -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_L :: DynFlags -> [String]
opt_L :: DynFlags -> [String]
opt_L DynFlags
dflags = ToolSettings -> [String]
toolSettings_opt_L (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_P :: DynFlags -> [String]
opt_P :: DynFlags -> [String]
opt_P DynFlags
dflags = (Way -> [String]) -> Ways -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptP (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> Ways
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ ToolSettings -> [String]
toolSettings_opt_P (DynFlags -> ToolSettings
toolSettings DynFlags
dflags)
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P_signature DynFlags
dflags =
( (Way -> [String]) -> Ways -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptP (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> Ways
ways DynFlags
dflags)
, ToolSettings -> Fingerprint
toolSettings_opt_P_fingerprint (ToolSettings -> Fingerprint) -> ToolSettings -> Fingerprint
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
)
opt_F :: DynFlags -> [String]
opt_F :: DynFlags -> [String]
opt_F DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_F (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_c :: DynFlags -> [String]
opt_c :: DynFlags -> [String]
opt_c DynFlags
dflags = (Way -> [String]) -> Ways -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptc (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> Ways
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ ToolSettings -> [String]
toolSettings_opt_c (DynFlags -> ToolSettings
toolSettings DynFlags
dflags)
opt_cxx :: DynFlags -> [String]
opt_cxx :: DynFlags -> [String]
opt_cxx DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_cxx (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_a :: DynFlags -> [String]
opt_a :: DynFlags -> [String]
opt_a DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_a (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_l :: DynFlags -> [String]
opt_l :: DynFlags -> [String]
opt_l DynFlags
dflags = (Way -> [String]) -> Ways -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptl (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> Ways
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ ToolSettings -> [String]
toolSettings_opt_l (DynFlags -> ToolSettings
toolSettings DynFlags
dflags)
opt_lm :: DynFlags -> [String]
opt_lm :: DynFlags -> [String]
opt_lm DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_lm (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_windres :: DynFlags -> [String]
opt_windres :: DynFlags -> [String]
opt_windres DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_windres (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_lcc :: DynFlags -> [String]
opt_lcc :: DynFlags -> [String]
opt_lcc DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_lcc (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_lo :: DynFlags -> [String]
opt_lo :: DynFlags -> [String]
opt_lo DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_lo (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_lc :: DynFlags -> [String]
opt_lc :: DynFlags -> [String]
opt_lc DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_lc (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
opt_i :: DynFlags -> [String]
opt_i :: DynFlags -> [String]
opt_i DynFlags
dflags= ToolSettings -> [String]
toolSettings_opt_i (ToolSettings -> [String]) -> ToolSettings -> [String]
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
versionedAppDir :: String -> ArchOS -> MaybeT IO FilePath
versionedAppDir :: String -> ArchOS -> MaybeT IO String
versionedAppDir String
appname ArchOS
platform = do
[MaybeT IO String] -> MaybeT IO String
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, MonadPlus m) =>
t (m a) -> m a
msum ([MaybeT IO String] -> MaybeT IO String)
-> [MaybeT IO String] -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ (MaybeT IO String -> MaybeT IO String)
-> [MaybeT IO String] -> [MaybeT IO String]
forall a b. (a -> b) -> [a] -> [b]
map (String -> MaybeT IO String
checkIfExists (String -> MaybeT IO String)
-> (MaybeT IO String -> MaybeT IO String)
-> MaybeT IO String
-> MaybeT IO String
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< ShowS -> MaybeT IO String -> MaybeT IO String
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (String -> ShowS
</> ArchOS -> String
versionedFilePath ArchOS
platform))
[ IO String -> MaybeT IO String
forall a. IO a -> MaybeT IO a
tryMaybeT (IO String -> MaybeT IO String) -> IO String -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ String -> IO String
getAppUserDataDirectory String
appname
, IO String -> MaybeT IO String
forall a. IO a -> MaybeT IO a
tryMaybeT (IO String -> MaybeT IO String) -> IO String -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ XdgDirectory -> String -> IO String
getXdgDirectory XdgDirectory
XdgData String
appname
]
where
checkIfExists :: String -> MaybeT IO String
checkIfExists String
dir = IO Bool -> MaybeT IO Bool
forall a. IO a -> MaybeT IO a
tryMaybeT (String -> IO Bool
doesDirectoryExist String
dir) MaybeT IO Bool -> (Bool -> MaybeT IO String) -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
Bool
True -> String -> MaybeT IO String
forall (f :: * -> *) a. Applicative f => a -> f a
pure String
dir
Bool
False -> IO (Maybe String) -> MaybeT IO String
forall (m :: * -> *) a. m (Maybe a) -> MaybeT m a
MaybeT (Maybe String -> IO (Maybe String)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe String
forall a. Maybe a
Nothing)
versionedFilePath :: ArchOS -> FilePath
versionedFilePath :: ArchOS -> String
versionedFilePath ArchOS
platform = ArchOS -> String
uniqueSubdir ArchOS
platform
data GhcMode
= CompManager
| OneShot
| MkDepend
deriving GhcMode -> GhcMode -> Bool
(GhcMode -> GhcMode -> Bool)
-> (GhcMode -> GhcMode -> Bool) -> Eq GhcMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GhcMode -> GhcMode -> Bool
$c/= :: GhcMode -> GhcMode -> Bool
== :: GhcMode -> GhcMode -> Bool
$c== :: GhcMode -> GhcMode -> Bool
Eq
instance Outputable GhcMode where
ppr :: GhcMode -> SDoc
ppr GhcMode
CompManager = String -> SDoc
text String
"CompManager"
ppr GhcMode
OneShot = String -> SDoc
text String
"OneShot"
ppr GhcMode
MkDepend = String -> SDoc
text String
"MkDepend"
isOneShot :: GhcMode -> Bool
isOneShot :: GhcMode -> Bool
isOneShot GhcMode
OneShot = Bool
True
isOneShot GhcMode
_other = Bool
False
data GhcLink
= NoLink
| LinkBinary
| LinkInMemory
| LinkDynLib
| LinkStaticLib
| LinkMergedObj
deriving (GhcLink -> GhcLink -> Bool
(GhcLink -> GhcLink -> Bool)
-> (GhcLink -> GhcLink -> Bool) -> Eq GhcLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GhcLink -> GhcLink -> Bool
$c/= :: GhcLink -> GhcLink -> Bool
== :: GhcLink -> GhcLink -> Bool
$c== :: GhcLink -> GhcLink -> Bool
Eq, Int -> GhcLink -> ShowS
[GhcLink] -> ShowS
GhcLink -> String
(Int -> GhcLink -> ShowS)
-> (GhcLink -> String) -> ([GhcLink] -> ShowS) -> Show GhcLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GhcLink] -> ShowS
$cshowList :: [GhcLink] -> ShowS
show :: GhcLink -> String
$cshow :: GhcLink -> String
showsPrec :: Int -> GhcLink -> ShowS
$cshowsPrec :: Int -> GhcLink -> ShowS
Show)
isNoLink :: GhcLink -> Bool
isNoLink :: GhcLink -> Bool
isNoLink GhcLink
NoLink = Bool
True
isNoLink GhcLink
_ = Bool
False
data PackageArg =
PackageArg String
| UnitIdArg Unit
deriving (PackageArg -> PackageArg -> Bool
(PackageArg -> PackageArg -> Bool)
-> (PackageArg -> PackageArg -> Bool) -> Eq PackageArg
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageArg -> PackageArg -> Bool
$c/= :: PackageArg -> PackageArg -> Bool
== :: PackageArg -> PackageArg -> Bool
$c== :: PackageArg -> PackageArg -> Bool
Eq, Int -> PackageArg -> ShowS
[PackageArg] -> ShowS
PackageArg -> String
(Int -> PackageArg -> ShowS)
-> (PackageArg -> String)
-> ([PackageArg] -> ShowS)
-> Show PackageArg
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageArg] -> ShowS
$cshowList :: [PackageArg] -> ShowS
show :: PackageArg -> String
$cshow :: PackageArg -> String
showsPrec :: Int -> PackageArg -> ShowS
$cshowsPrec :: Int -> PackageArg -> ShowS
Show)
instance Outputable PackageArg where
ppr :: PackageArg -> SDoc
ppr (PackageArg String
pn) = String -> SDoc
text String
"package" SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
pn
ppr (UnitIdArg Unit
uid) = String -> SDoc
text String
"unit" SDoc -> SDoc -> SDoc
<+> Unit -> SDoc
forall a. Outputable a => a -> SDoc
ppr Unit
uid
data ModRenaming = ModRenaming {
ModRenaming -> Bool
modRenamingWithImplicit :: Bool,
ModRenaming -> [(ModuleName, ModuleName)]
modRenamings :: [(ModuleName, ModuleName)]
} deriving (ModRenaming -> ModRenaming -> Bool
(ModRenaming -> ModRenaming -> Bool)
-> (ModRenaming -> ModRenaming -> Bool) -> Eq ModRenaming
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModRenaming -> ModRenaming -> Bool
$c/= :: ModRenaming -> ModRenaming -> Bool
== :: ModRenaming -> ModRenaming -> Bool
$c== :: ModRenaming -> ModRenaming -> Bool
Eq)
instance Outputable ModRenaming where
ppr :: ModRenaming -> SDoc
ppr (ModRenaming Bool
b [(ModuleName, ModuleName)]
rns) = Bool -> SDoc
forall a. Outputable a => a -> SDoc
ppr Bool
b SDoc -> SDoc -> SDoc
<+> SDoc -> SDoc
parens ([(ModuleName, ModuleName)] -> SDoc
forall a. Outputable a => a -> SDoc
ppr [(ModuleName, ModuleName)]
rns)
newtype IgnorePackageFlag = IgnorePackage String
deriving (IgnorePackageFlag -> IgnorePackageFlag -> Bool
(IgnorePackageFlag -> IgnorePackageFlag -> Bool)
-> (IgnorePackageFlag -> IgnorePackageFlag -> Bool)
-> Eq IgnorePackageFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IgnorePackageFlag -> IgnorePackageFlag -> Bool
$c/= :: IgnorePackageFlag -> IgnorePackageFlag -> Bool
== :: IgnorePackageFlag -> IgnorePackageFlag -> Bool
$c== :: IgnorePackageFlag -> IgnorePackageFlag -> Bool
Eq)
data TrustFlag
= TrustPackage String
| DistrustPackage String
deriving (TrustFlag -> TrustFlag -> Bool
(TrustFlag -> TrustFlag -> Bool)
-> (TrustFlag -> TrustFlag -> Bool) -> Eq TrustFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrustFlag -> TrustFlag -> Bool
$c/= :: TrustFlag -> TrustFlag -> Bool
== :: TrustFlag -> TrustFlag -> Bool
$c== :: TrustFlag -> TrustFlag -> Bool
Eq)
data PackageFlag
= ExposePackage String PackageArg ModRenaming
| HidePackage String
deriving (PackageFlag -> PackageFlag -> Bool
(PackageFlag -> PackageFlag -> Bool)
-> (PackageFlag -> PackageFlag -> Bool) -> Eq PackageFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageFlag -> PackageFlag -> Bool
$c/= :: PackageFlag -> PackageFlag -> Bool
== :: PackageFlag -> PackageFlag -> Bool
$c== :: PackageFlag -> PackageFlag -> Bool
Eq)
data PackageDBFlag
= PackageDB PkgDbRef
| NoUserPackageDB
| NoGlobalPackageDB
| ClearPackageDBs
deriving (PackageDBFlag -> PackageDBFlag -> Bool
(PackageDBFlag -> PackageDBFlag -> Bool)
-> (PackageDBFlag -> PackageDBFlag -> Bool) -> Eq PackageDBFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageDBFlag -> PackageDBFlag -> Bool
$c/= :: PackageDBFlag -> PackageDBFlag -> Bool
== :: PackageDBFlag -> PackageDBFlag -> Bool
$c== :: PackageDBFlag -> PackageDBFlag -> Bool
Eq)
packageFlagsChanged :: DynFlags -> DynFlags -> Bool
packageFlagsChanged :: DynFlags -> DynFlags -> Bool
packageFlagsChanged DynFlags
idflags1 DynFlags
idflags0 =
DynFlags -> [PackageFlag]
packageFlags DynFlags
idflags1 [PackageFlag] -> [PackageFlag] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [PackageFlag]
packageFlags DynFlags
idflags0 Bool -> Bool -> Bool
||
DynFlags -> [IgnorePackageFlag]
ignorePackageFlags DynFlags
idflags1 [IgnorePackageFlag] -> [IgnorePackageFlag] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [IgnorePackageFlag]
ignorePackageFlags DynFlags
idflags0 Bool -> Bool -> Bool
||
DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
idflags1 [PackageFlag] -> [PackageFlag] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
idflags0 Bool -> Bool -> Bool
||
DynFlags -> [TrustFlag]
trustFlags DynFlags
idflags1 [TrustFlag] -> [TrustFlag] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [TrustFlag]
trustFlags DynFlags
idflags0 Bool -> Bool -> Bool
||
DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
idflags1 [PackageDBFlag] -> [PackageDBFlag] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
idflags0 Bool -> Bool -> Bool
||
DynFlags -> [Bool]
packageGFlags DynFlags
idflags1 [Bool] -> [Bool] -> Bool
forall a. Eq a => a -> a -> Bool
/= DynFlags -> [Bool]
packageGFlags DynFlags
idflags0
where
packageGFlags :: DynFlags -> [Bool]
packageGFlags DynFlags
dflags = (GeneralFlag -> Bool) -> [GeneralFlag] -> [Bool]
forall a b. (a -> b) -> [a] -> [b]
map (GeneralFlag -> DynFlags -> Bool
`gopt` DynFlags
dflags)
[ GeneralFlag
Opt_HideAllPackages
, GeneralFlag
Opt_HideAllPluginPackages
, GeneralFlag
Opt_AutoLinkPackages ]
instance Outputable PackageFlag where
ppr :: PackageFlag -> SDoc
ppr (ExposePackage String
n PackageArg
arg ModRenaming
rn) = String -> SDoc
text String
n SDoc -> SDoc -> SDoc
<> SDoc -> SDoc
braces (PackageArg -> SDoc
forall a. Outputable a => a -> SDoc
ppr PackageArg
arg SDoc -> SDoc -> SDoc
<+> ModRenaming -> SDoc
forall a. Outputable a => a -> SDoc
ppr ModRenaming
rn)
ppr (HidePackage String
str) = String -> SDoc
text String
"-hide-package" SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
str
data DynLibLoader
= Deployable
| SystemDependent
deriving DynLibLoader -> DynLibLoader -> Bool
(DynLibLoader -> DynLibLoader -> Bool)
-> (DynLibLoader -> DynLibLoader -> Bool) -> Eq DynLibLoader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynLibLoader -> DynLibLoader -> Bool
$c/= :: DynLibLoader -> DynLibLoader -> Bool
== :: DynLibLoader -> DynLibLoader -> Bool
$c== :: DynLibLoader -> DynLibLoader -> Bool
Eq
data RtsOptsEnabled
= RtsOptsNone | RtsOptsIgnore | RtsOptsIgnoreAll | RtsOptsSafeOnly
| RtsOptsAll
deriving (Int -> RtsOptsEnabled -> ShowS
[RtsOptsEnabled] -> ShowS
RtsOptsEnabled -> String
(Int -> RtsOptsEnabled -> ShowS)
-> (RtsOptsEnabled -> String)
-> ([RtsOptsEnabled] -> ShowS)
-> Show RtsOptsEnabled
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RtsOptsEnabled] -> ShowS
$cshowList :: [RtsOptsEnabled] -> ShowS
show :: RtsOptsEnabled -> String
$cshow :: RtsOptsEnabled -> String
showsPrec :: Int -> RtsOptsEnabled -> ShowS
$cshowsPrec :: Int -> RtsOptsEnabled -> ShowS
Show)
positionIndependent :: DynFlags -> Bool
positionIndependent :: DynFlags -> Bool
positionIndependent DynFlags
dflags = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags Bool -> Bool -> Bool
|| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIE DynFlags
dflags
data DynamicTooState
= DT_Dont
| DT_OK
| DT_Dyn
deriving (DynamicTooState -> DynamicTooState -> Bool
(DynamicTooState -> DynamicTooState -> Bool)
-> (DynamicTooState -> DynamicTooState -> Bool)
-> Eq DynamicTooState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynamicTooState -> DynamicTooState -> Bool
$c/= :: DynamicTooState -> DynamicTooState -> Bool
== :: DynamicTooState -> DynamicTooState -> Bool
$c== :: DynamicTooState -> DynamicTooState -> Bool
Eq,Int -> DynamicTooState -> ShowS
[DynamicTooState] -> ShowS
DynamicTooState -> String
(Int -> DynamicTooState -> ShowS)
-> (DynamicTooState -> String)
-> ([DynamicTooState] -> ShowS)
-> Show DynamicTooState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DynamicTooState] -> ShowS
$cshowList :: [DynamicTooState] -> ShowS
show :: DynamicTooState -> String
$cshow :: DynamicTooState -> String
showsPrec :: Int -> DynamicTooState -> ShowS
$cshowsPrec :: Int -> DynamicTooState -> ShowS
Show,Eq DynamicTooState
Eq DynamicTooState
-> (DynamicTooState -> DynamicTooState -> Ordering)
-> (DynamicTooState -> DynamicTooState -> Bool)
-> (DynamicTooState -> DynamicTooState -> Bool)
-> (DynamicTooState -> DynamicTooState -> Bool)
-> (DynamicTooState -> DynamicTooState -> Bool)
-> (DynamicTooState -> DynamicTooState -> DynamicTooState)
-> (DynamicTooState -> DynamicTooState -> DynamicTooState)
-> Ord DynamicTooState
DynamicTooState -> DynamicTooState -> Bool
DynamicTooState -> DynamicTooState -> Ordering
DynamicTooState -> DynamicTooState -> DynamicTooState
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DynamicTooState -> DynamicTooState -> DynamicTooState
$cmin :: DynamicTooState -> DynamicTooState -> DynamicTooState
max :: DynamicTooState -> DynamicTooState -> DynamicTooState
$cmax :: DynamicTooState -> DynamicTooState -> DynamicTooState
>= :: DynamicTooState -> DynamicTooState -> Bool
$c>= :: DynamicTooState -> DynamicTooState -> Bool
> :: DynamicTooState -> DynamicTooState -> Bool
$c> :: DynamicTooState -> DynamicTooState -> Bool
<= :: DynamicTooState -> DynamicTooState -> Bool
$c<= :: DynamicTooState -> DynamicTooState -> Bool
< :: DynamicTooState -> DynamicTooState -> Bool
$c< :: DynamicTooState -> DynamicTooState -> Bool
compare :: DynamicTooState -> DynamicTooState -> Ordering
$ccompare :: DynamicTooState -> DynamicTooState -> Ordering
$cp1Ord :: Eq DynamicTooState
Ord)
dynamicTooState :: DynFlags -> DynamicTooState
dynamicTooState :: DynFlags -> DynamicTooState
dynamicTooState DynFlags
dflags
| Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_BuildDynamicToo DynFlags
dflags) = DynamicTooState
DT_Dont
| DynFlags -> Bool
dynamicNow DynFlags
dflags = DynamicTooState
DT_Dyn
| Bool
otherwise = DynamicTooState
DT_OK
setDynamicNow :: DynFlags -> DynFlags
setDynamicNow :: DynFlags -> DynFlags
setDynamicNow DynFlags
dflags0 =
DynFlags
dflags0
{ dynamicNow :: Bool
dynamicNow = Bool
True
}
initDynFlags :: DynFlags -> IO DynFlags
initDynFlags :: DynFlags -> IO DynFlags
initDynFlags DynFlags
dflags = do
let
IORef (Maybe LinkerInfo)
refRtldInfo <- Maybe LinkerInfo -> IO (IORef (Maybe LinkerInfo))
forall a. a -> IO (IORef a)
newIORef Maybe LinkerInfo
forall a. Maybe a
Nothing
IORef (Maybe CompilerInfo)
refRtccInfo <- Maybe CompilerInfo -> IO (IORef (Maybe CompilerInfo))
forall a. a -> IO (IORef a)
newIORef Maybe CompilerInfo
forall a. Maybe a
Nothing
IORef (Maybe CompilerInfo)
refRtasmInfo <- Maybe CompilerInfo -> IO (IORef (Maybe CompilerInfo))
forall a. a -> IO (IORef a)
newIORef Maybe CompilerInfo
forall a. Maybe a
Nothing
Bool
canUseUnicode <- do let enc :: TextEncoding
enc = TextEncoding
localeEncoding
str :: String
str = String
"‘’"
(TextEncoding -> String -> (CString -> IO Bool) -> IO Bool
forall a. TextEncoding -> String -> (CString -> IO a) -> IO a
withCString TextEncoding
enc String
str ((CString -> IO Bool) -> IO Bool)
-> (CString -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \CString
cstr ->
do String
str' <- TextEncoding -> CString -> IO String
peekCString TextEncoding
enc CString
cstr
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return (String
str String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
str'))
IO Bool -> (IOError -> IO Bool) -> IO Bool
forall a. IO a -> (IOError -> IO a) -> IO a
`catchIOError` \IOError
_ -> Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False
Maybe String
ghcNoUnicodeEnv <- String -> IO (Maybe String)
lookupEnv String
"GHC_NO_UNICODE"
let useUnicode' :: Bool
useUnicode' = Maybe String -> Bool
forall a. Maybe a -> Bool
isNothing Maybe String
ghcNoUnicodeEnv Bool -> Bool -> Bool
&& Bool
canUseUnicode
Maybe String
maybeGhcColorsEnv <- String -> IO (Maybe String)
lookupEnv String
"GHC_COLORS"
Maybe String
maybeGhcColoursEnv <- String -> IO (Maybe String)
lookupEnv String
"GHC_COLOURS"
let adjustCols :: Maybe String
-> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
adjustCols (Just String
env) = String -> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
Col.parseScheme String
env
adjustCols Maybe String
Nothing = (OverridingBool, Scheme) -> (OverridingBool, Scheme)
forall a. a -> a
id
let (OverridingBool
useColor', Scheme
colScheme') =
(Maybe String
-> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
adjustCols Maybe String
maybeGhcColoursEnv ((OverridingBool, Scheme) -> (OverridingBool, Scheme))
-> ((OverridingBool, Scheme) -> (OverridingBool, Scheme))
-> (OverridingBool, Scheme)
-> (OverridingBool, Scheme)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe String
-> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
adjustCols Maybe String
maybeGhcColorsEnv)
(DynFlags -> OverridingBool
useColor DynFlags
dflags, DynFlags -> Scheme
colScheme DynFlags
dflags)
String
tmp_dir <- ShowS
normalise ShowS -> IO String -> IO String
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO String
getTemporaryDirectory
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags{
useUnicode :: Bool
useUnicode = Bool
useUnicode',
useColor :: OverridingBool
useColor = OverridingBool
useColor',
canUseColor :: Bool
canUseColor = Bool
stderrSupportsAnsiColors,
colScheme :: Scheme
colScheme = Scheme
colScheme',
rtldInfo :: IORef (Maybe LinkerInfo)
rtldInfo = IORef (Maybe LinkerInfo)
refRtldInfo,
rtccInfo :: IORef (Maybe CompilerInfo)
rtccInfo = IORef (Maybe CompilerInfo)
refRtccInfo,
rtasmInfo :: IORef (Maybe CompilerInfo)
rtasmInfo = IORef (Maybe CompilerInfo)
refRtasmInfo,
tmpDir :: TempDir
tmpDir = String -> TempDir
TempDir String
tmp_dir
}
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags
defaultDynFlags Settings
mySettings LlvmConfig
llvmConfig =
DynFlags :: GhcMode
-> GhcLink
-> Backend
-> GhcNameVersion
-> FileSettings
-> Platform
-> ToolSettings
-> PlatformMisc
-> [(String, String)]
-> TempDir
-> LlvmConfig
-> Int
-> Int
-> Int
-> Int
-> Int
-> Maybe String
-> [Int]
-> Maybe Int
-> Bool
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Int
-> Int
-> Int
-> Int
-> Maybe Int
-> Maybe Int
-> Int
-> Maybe Word
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Bool
-> Maybe Int
-> Int
-> [String]
-> ModuleName
-> Maybe String
-> IntWithInf
-> IntWithInf
-> UnitId
-> Maybe UnitId
-> [(ModuleName, Module)]
-> Maybe String
-> Maybe String
-> Set ModuleName
-> Set ModuleName
-> Ways
-> Maybe (String, Int)
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> String
-> String
-> String
-> String
-> String
-> String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> DynLibLoader
-> Bool
-> String
-> Maybe String
-> [Option]
-> IncludeSpecs
-> [String]
-> [String]
-> [String]
-> Maybe String
-> RtsOptsEnabled
-> Bool
-> String
-> [ModuleName]
-> [(ModuleName, String)]
-> [String]
-> String
-> Bool
-> Bool
-> [ModuleName]
-> [String]
-> [PackageDBFlag]
-> [IgnorePackageFlag]
-> [PackageFlag]
-> [PackageFlag]
-> [TrustFlag]
-> Maybe String
-> EnumSet DumpFlag
-> EnumSet GeneralFlag
-> EnumSet WarningFlag
-> EnumSet WarningFlag
-> Maybe Language
-> SafeHaskellMode
-> Bool
-> Bool
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> [OnOff Extension]
-> EnumSet Extension
-> UnfoldingOpts
-> Int
-> Int
-> FlushOut
-> Maybe String
-> Maybe String
-> [String]
-> Int
-> Int
-> Bool
-> OverridingBool
-> Bool
-> Scheme
-> ProfAuto
-> [CallerCcFilter]
-> Maybe String
-> Maybe SseVersion
-> Maybe BmiVersion
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> IORef (Maybe LinkerInfo)
-> IORef (Maybe CompilerInfo)
-> IORef (Maybe CompilerInfo)
-> Int
-> Int
-> Int
-> Bool
-> Maybe Int
-> Word
-> Int
-> Weights
-> DynFlags
DynFlags {
ghcMode :: GhcMode
ghcMode = GhcMode
CompManager,
ghcLink :: GhcLink
ghcLink = GhcLink
LinkBinary,
backend :: Backend
backend = Platform -> Backend
platformDefaultBackend (Settings -> Platform
sTargetPlatform Settings
mySettings),
verbosity :: Int
verbosity = Int
0,
debugLevel :: Int
debugLevel = Int
0,
simplPhases :: Int
simplPhases = Int
2,
maxSimplIterations :: Int
maxSimplIterations = Int
4,
ruleCheck :: Maybe String
ruleCheck = Maybe String
forall a. Maybe a
Nothing,
binBlobThreshold :: Maybe Word
binBlobThreshold = Word -> Maybe Word
forall a. a -> Maybe a
Just Word
500000,
maxRelevantBinds :: Maybe Int
maxRelevantBinds = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
6,
maxValidHoleFits :: Maybe Int
maxValidHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
6,
maxRefHoleFits :: Maybe Int
maxRefHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
6,
refLevelHoleFits :: Maybe Int
refLevelHoleFits = Maybe Int
forall a. Maybe a
Nothing,
maxUncoveredPatterns :: Int
maxUncoveredPatterns = Int
4,
maxPmCheckModels :: Int
maxPmCheckModels = Int
30,
simplTickFactor :: Int
simplTickFactor = Int
100,
dmdUnboxWidth :: Int
dmdUnboxWidth = Int
3,
specConstrThreshold :: Maybe Int
specConstrThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
2000,
specConstrCount :: Maybe Int
specConstrCount = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
3,
specConstrRecursive :: Int
specConstrRecursive = Int
3,
liberateCaseThreshold :: Maybe Int
liberateCaseThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
2000,
floatLamArgs :: Maybe Int
floatLamArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
0,
liftLamsRecArgs :: Maybe Int
liftLamsRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
5,
liftLamsNonRecArgs :: Maybe Int
liftLamsNonRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
5,
liftLamsKnown :: Bool
liftLamsKnown = Bool
False,
cmmProcAlignment :: Maybe Int
cmmProcAlignment = Maybe Int
forall a. Maybe a
Nothing,
historySize :: Int
historySize = Int
20,
strictnessBefore :: [Int]
strictnessBefore = [],
parMakeCount :: Maybe Int
parMakeCount = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1,
enableTimeStats :: Bool
enableTimeStats = Bool
False,
ghcHeapSize :: Maybe Int
ghcHeapSize = Maybe Int
forall a. Maybe a
Nothing,
importPaths :: [String]
importPaths = [String
"."],
mainModuleNameIs :: ModuleName
mainModuleNameIs = ModuleName
mAIN_NAME,
mainFunIs :: Maybe String
mainFunIs = Maybe String
forall a. Maybe a
Nothing,
reductionDepth :: IntWithInf
reductionDepth = Int -> IntWithInf
treatZeroAsInf Int
mAX_REDUCTION_DEPTH,
solverIterations :: IntWithInf
solverIterations = Int -> IntWithInf
treatZeroAsInf Int
mAX_SOLVER_ITERATIONS,
homeUnitId_ :: UnitId
homeUnitId_ = UnitId
mainUnitId,
homeUnitInstanceOf_ :: Maybe UnitId
homeUnitInstanceOf_ = Maybe UnitId
forall a. Maybe a
Nothing,
homeUnitInstantiations_ :: [(ModuleName, Module)]
homeUnitInstantiations_ = [],
workingDirectory :: Maybe String
workingDirectory = Maybe String
forall a. Maybe a
Nothing,
thisPackageName :: Maybe String
thisPackageName = Maybe String
forall a. Maybe a
Nothing,
hiddenModules :: Set ModuleName
hiddenModules = Set ModuleName
forall a. Set a
Set.empty,
reexportedModules :: Set ModuleName
reexportedModules = Set ModuleName
forall a. Set a
Set.empty,
objectDir :: Maybe String
objectDir = Maybe String
forall a. Maybe a
Nothing,
dylibInstallName :: Maybe String
dylibInstallName = Maybe String
forall a. Maybe a
Nothing,
hiDir :: Maybe String
hiDir = Maybe String
forall a. Maybe a
Nothing,
hieDir :: Maybe String
hieDir = Maybe String
forall a. Maybe a
Nothing,
stubDir :: Maybe String
stubDir = Maybe String
forall a. Maybe a
Nothing,
dumpDir :: Maybe String
dumpDir = Maybe String
forall a. Maybe a
Nothing,
objectSuf_ :: String
objectSuf_ = Phase -> String
phaseInputExt Phase
StopLn,
hcSuf :: String
hcSuf = Phase -> String
phaseInputExt Phase
HCc,
hiSuf_ :: String
hiSuf_ = String
"hi",
hieSuf :: String
hieSuf = String
"hie",
dynObjectSuf_ :: String
dynObjectSuf_ = String
"dyn_" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Phase -> String
phaseInputExt Phase
StopLn,
dynHiSuf_ :: String
dynHiSuf_ = String
"dyn_hi",
dynamicNow :: Bool
dynamicNow = Bool
False,
pluginModNames :: [ModuleName]
pluginModNames = [],
pluginModNameOpts :: [(ModuleName, String)]
pluginModNameOpts = [],
frontendPluginOpts :: [String]
frontendPluginOpts = [],
outputFile_ :: Maybe String
outputFile_ = Maybe String
forall a. Maybe a
Nothing,
dynOutputFile_ :: Maybe String
dynOutputFile_ = Maybe String
forall a. Maybe a
Nothing,
outputHi :: Maybe String
outputHi = Maybe String
forall a. Maybe a
Nothing,
dynOutputHi :: Maybe String
dynOutputHi = Maybe String
forall a. Maybe a
Nothing,
dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
SystemDependent,
dumpPrefix :: String
dumpPrefix = String
"non-module.",
dumpPrefixForce :: Maybe String
dumpPrefixForce = Maybe String
forall a. Maybe a
Nothing,
ldInputs :: [Option]
ldInputs = [],
includePaths :: IncludeSpecs
includePaths = [String] -> [String] -> [String] -> IncludeSpecs
IncludeSpecs [] [] [],
libraryPaths :: [String]
libraryPaths = [],
frameworkPaths :: [String]
frameworkPaths = [],
cmdlineFrameworks :: [String]
cmdlineFrameworks = [],
rtsOpts :: Maybe String
rtsOpts = Maybe String
forall a. Maybe a
Nothing,
rtsOptsEnabled :: RtsOptsEnabled
rtsOptsEnabled = RtsOptsEnabled
RtsOptsSafeOnly,
rtsOptsSuggestions :: Bool
rtsOptsSuggestions = Bool
True,
hpcDir :: String
hpcDir = String
".hpc",
packageDBFlags :: [PackageDBFlag]
packageDBFlags = [],
packageFlags :: [PackageFlag]
packageFlags = [],
pluginPackageFlags :: [PackageFlag]
pluginPackageFlags = [],
ignorePackageFlags :: [IgnorePackageFlag]
ignorePackageFlags = [],
trustFlags :: [TrustFlag]
trustFlags = [],
packageEnv :: Maybe String
packageEnv = Maybe String
forall a. Maybe a
Nothing,
targetWays_ :: Ways
targetWays_ = Ways
forall a. Set a
Set.empty,
splitInfo :: Maybe (String, Int)
splitInfo = Maybe (String, Int)
forall a. Maybe a
Nothing,
ghcNameVersion :: GhcNameVersion
ghcNameVersion = Settings -> GhcNameVersion
sGhcNameVersion Settings
mySettings,
fileSettings :: FileSettings
fileSettings = Settings -> FileSettings
sFileSettings Settings
mySettings,
toolSettings :: ToolSettings
toolSettings = Settings -> ToolSettings
sToolSettings Settings
mySettings,
targetPlatform :: Platform
targetPlatform = Settings -> Platform
sTargetPlatform Settings
mySettings,
platformMisc :: PlatformMisc
platformMisc = Settings -> PlatformMisc
sPlatformMisc Settings
mySettings,
rawSettings :: [(String, String)]
rawSettings = Settings -> [(String, String)]
sRawSettings Settings
mySettings,
tmpDir :: TempDir
tmpDir = String -> TempDir
forall a. String -> a
panic String
"defaultDynFlags: uninitialized tmpDir",
llvmConfig :: LlvmConfig
llvmConfig = LlvmConfig
llvmConfig,
llvmOptLevel :: Int
llvmOptLevel = Int
0,
depMakefile :: String
depMakefile = String
"Makefile",
depIncludePkgDeps :: Bool
depIncludePkgDeps = Bool
False,
depIncludeCppDeps :: Bool
depIncludeCppDeps = Bool
False,
depExcludeMods :: [ModuleName]
depExcludeMods = [],
depSuffixes :: [String]
depSuffixes = [],
ghcVersionFile :: Maybe String
ghcVersionFile = Maybe String
forall a. Maybe a
Nothing,
haddockOptions :: Maybe String
haddockOptions = Maybe String
forall a. Maybe a
Nothing,
dumpFlags :: EnumSet DumpFlag
dumpFlags = EnumSet DumpFlag
forall a. EnumSet a
EnumSet.empty,
generalFlags :: EnumSet GeneralFlag
generalFlags = [GeneralFlag] -> EnumSet GeneralFlag
forall a. Enum a => [a] -> EnumSet a
EnumSet.fromList (Settings -> [GeneralFlag]
defaultFlags Settings
mySettings),
warningFlags :: EnumSet WarningFlag
warningFlags = [WarningFlag] -> EnumSet WarningFlag
forall a. Enum a => [a] -> EnumSet a
EnumSet.fromList [WarningFlag]
standardWarnings,
fatalWarningFlags :: EnumSet WarningFlag
fatalWarningFlags = EnumSet WarningFlag
forall a. EnumSet a
EnumSet.empty,
ghciScripts :: [String]
ghciScripts = [],
language :: Maybe Language
language = Maybe Language
forall a. Maybe a
Nothing,
safeHaskell :: SafeHaskellMode
safeHaskell = SafeHaskellMode
Sf_None,
safeInfer :: Bool
safeInfer = Bool
True,
safeInferred :: Bool
safeInferred = Bool
True,
thOnLoc :: SrcSpan
thOnLoc = SrcSpan
noSrcSpan,
newDerivOnLoc :: SrcSpan
newDerivOnLoc = SrcSpan
noSrcSpan,
deriveViaOnLoc :: SrcSpan
deriveViaOnLoc = SrcSpan
noSrcSpan,
overlapInstLoc :: SrcSpan
overlapInstLoc = SrcSpan
noSrcSpan,
incoherentOnLoc :: SrcSpan
incoherentOnLoc = SrcSpan
noSrcSpan,
pkgTrustOnLoc :: SrcSpan
pkgTrustOnLoc = SrcSpan
noSrcSpan,
warnSafeOnLoc :: SrcSpan
warnSafeOnLoc = SrcSpan
noSrcSpan,
warnUnsafeOnLoc :: SrcSpan
warnUnsafeOnLoc = SrcSpan
noSrcSpan,
trustworthyOnLoc :: SrcSpan
trustworthyOnLoc = SrcSpan
noSrcSpan,
extensions :: [OnOff Extension]
extensions = [],
extensionFlags :: EnumSet Extension
extensionFlags = Maybe Language -> [OnOff Extension] -> EnumSet Extension
flattenExtensionFlags Maybe Language
forall a. Maybe a
Nothing [],
unfoldingOpts :: UnfoldingOpts
unfoldingOpts = UnfoldingOpts
defaultUnfoldingOpts,
maxWorkerArgs :: Int
maxWorkerArgs = Int
10,
ghciHistSize :: Int
ghciHistSize = Int
50,
flushOut :: FlushOut
flushOut = FlushOut
defaultFlushOut,
pprUserLength :: Int
pprUserLength = Int
5,
pprCols :: Int
pprCols = Int
100,
useUnicode :: Bool
useUnicode = Bool
False,
useColor :: OverridingBool
useColor = OverridingBool
Auto,
canUseColor :: Bool
canUseColor = Bool
False,
colScheme :: Scheme
colScheme = Scheme
Col.defaultScheme,
profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto,
callerCcFilters :: [CallerCcFilter]
callerCcFilters = [],
interactivePrint :: Maybe String
interactivePrint = Maybe String
forall a. Maybe a
Nothing,
sseVersion :: Maybe SseVersion
sseVersion = Maybe SseVersion
forall a. Maybe a
Nothing,
bmiVersion :: Maybe BmiVersion
bmiVersion = Maybe BmiVersion
forall a. Maybe a
Nothing,
avx :: Bool
avx = Bool
False,
avx2 :: Bool
avx2 = Bool
False,
avx512cd :: Bool
avx512cd = Bool
False,
avx512er :: Bool
avx512er = Bool
False,
avx512f :: Bool
avx512f = Bool
False,
avx512pf :: Bool
avx512pf = Bool
False,
rtldInfo :: IORef (Maybe LinkerInfo)
rtldInfo = String -> IORef (Maybe LinkerInfo)
forall a. String -> a
panic String
"defaultDynFlags: no rtldInfo",
rtccInfo :: IORef (Maybe CompilerInfo)
rtccInfo = String -> IORef (Maybe CompilerInfo)
forall a. String -> a
panic String
"defaultDynFlags: no rtccInfo",
rtasmInfo :: IORef (Maybe CompilerInfo)
rtasmInfo = String -> IORef (Maybe CompilerInfo)
forall a. String -> a
panic String
"defaultDynFlags: no rtasmInfo",
maxInlineAllocSize :: Int
maxInlineAllocSize = Int
128,
maxInlineMemcpyInsns :: Int
maxInlineMemcpyInsns = Int
32,
maxInlineMemsetInsns :: Int
maxInlineMemsetInsns = Int
32,
initialUnique :: Word
initialUnique = Word
0,
uniqueIncrement :: Int
uniqueIncrement = Int
1,
reverseErrors :: Bool
reverseErrors = Bool
False,
maxErrors :: Maybe Int
maxErrors = Maybe Int
forall a. Maybe a
Nothing,
cfgWeights :: Weights
cfgWeights = Weights
defaultWeights
}
type FatalMessager = String -> IO ()
defaultFatalMessager :: FatalMessager
defaultFatalMessager :: FatalMessager
defaultFatalMessager = Handle -> FatalMessager
hPutStrLn Handle
stderr
newtype FlushOut = FlushOut (IO ())
defaultFlushOut :: FlushOut
defaultFlushOut :: FlushOut
defaultFlushOut = IO () -> FlushOut
FlushOut (IO () -> FlushOut) -> IO () -> FlushOut
forall a b. (a -> b) -> a -> b
$ Handle -> IO ()
hFlush Handle
stdout
data OnOff a = On a
| Off a
deriving (OnOff a -> OnOff a -> Bool
(OnOff a -> OnOff a -> Bool)
-> (OnOff a -> OnOff a -> Bool) -> Eq (OnOff a)
forall a. Eq a => OnOff a -> OnOff a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OnOff a -> OnOff a -> Bool
$c/= :: forall a. Eq a => OnOff a -> OnOff a -> Bool
== :: OnOff a -> OnOff a -> Bool
$c== :: forall a. Eq a => OnOff a -> OnOff a -> Bool
Eq, Int -> OnOff a -> ShowS
[OnOff a] -> ShowS
OnOff a -> String
(Int -> OnOff a -> ShowS)
-> (OnOff a -> String) -> ([OnOff a] -> ShowS) -> Show (OnOff a)
forall a. Show a => Int -> OnOff a -> ShowS
forall a. Show a => [OnOff a] -> ShowS
forall a. Show a => OnOff a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OnOff a] -> ShowS
$cshowList :: forall a. Show a => [OnOff a] -> ShowS
show :: OnOff a -> String
$cshow :: forall a. Show a => OnOff a -> String
showsPrec :: Int -> OnOff a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> OnOff a -> ShowS
Show)
instance Outputable a => Outputable (OnOff a) where
ppr :: OnOff a -> SDoc
ppr (On a
x) = String -> SDoc
text String
"On" SDoc -> SDoc -> SDoc
<+> a -> SDoc
forall a. Outputable a => a -> SDoc
ppr a
x
ppr (Off a
x) = String -> SDoc
text String
"Off" SDoc -> SDoc -> SDoc
<+> a -> SDoc
forall a. Outputable a => a -> SDoc
ppr a
x
flattenExtensionFlags :: Maybe Language -> [OnOff LangExt.Extension] -> EnumSet LangExt.Extension
flattenExtensionFlags :: Maybe Language -> [OnOff Extension] -> EnumSet Extension
flattenExtensionFlags Maybe Language
ml = (OnOff Extension -> EnumSet Extension -> EnumSet Extension)
-> EnumSet Extension -> [OnOff Extension] -> EnumSet Extension
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr OnOff Extension -> EnumSet Extension -> EnumSet Extension
forall a. Enum a => OnOff a -> EnumSet a -> EnumSet a
f EnumSet Extension
defaultExtensionFlags
where f :: OnOff a -> EnumSet a -> EnumSet a
f (On a
f) EnumSet a
flags = a -> EnumSet a -> EnumSet a
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.insert a
f EnumSet a
flags
f (Off a
f) EnumSet a
flags = a -> EnumSet a -> EnumSet a
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.delete a
f EnumSet a
flags
defaultExtensionFlags :: EnumSet Extension
defaultExtensionFlags = [Extension] -> EnumSet Extension
forall a. Enum a => [a] -> EnumSet a
EnumSet.fromList (Maybe Language -> [Extension]
languageExtensions Maybe Language
ml)
languageExtensions :: Maybe Language -> [LangExt.Extension]
languageExtensions :: Maybe Language -> [Extension]
languageExtensions Maybe Language
Nothing = Maybe Language -> [Extension]
languageExtensions (Language -> Maybe Language
forall a. a -> Maybe a
Just Language
GHC2021)
languageExtensions (Just Language
Haskell98)
= [Extension
LangExt.ImplicitPrelude,
Extension
LangExt.StarIsType,
Extension
LangExt.CUSKs,
Extension
LangExt.MonomorphismRestriction,
Extension
LangExt.NPlusKPatterns,
Extension
LangExt.DatatypeContexts,
Extension
LangExt.TraditionalRecordSyntax,
Extension
LangExt.FieldSelectors,
Extension
LangExt.NondecreasingIndentation
]
languageExtensions (Just Language
Haskell2010)
= [Extension
LangExt.ImplicitPrelude,
Extension
LangExt.StarIsType,
Extension
LangExt.CUSKs,
Extension
LangExt.MonomorphismRestriction,
Extension
LangExt.DatatypeContexts,
Extension
LangExt.TraditionalRecordSyntax,
Extension
LangExt.EmptyDataDecls,
Extension
LangExt.ForeignFunctionInterface,
Extension
LangExt.PatternGuards,
Extension
LangExt.DoAndIfThenElse,
Extension
LangExt.FieldSelectors,
Extension
LangExt.RelaxedPolyRec]
languageExtensions (Just Language
GHC2021)
= [Extension
LangExt.ImplicitPrelude,
Extension
LangExt.StarIsType,
Extension
LangExt.MonomorphismRestriction,
Extension
LangExt.TraditionalRecordSyntax,
Extension
LangExt.EmptyDataDecls,
Extension
LangExt.ForeignFunctionInterface,
Extension
LangExt.PatternGuards,
Extension
LangExt.DoAndIfThenElse,
Extension
LangExt.FieldSelectors,
Extension
LangExt.RelaxedPolyRec,
Extension
LangExt.BangPatterns,
Extension
LangExt.BinaryLiterals,
Extension
LangExt.ConstrainedClassMethods,
Extension
LangExt.ConstraintKinds,
Extension
LangExt.DeriveDataTypeable,
Extension
LangExt.DeriveFoldable,
Extension
LangExt.DeriveFunctor,
Extension
LangExt.DeriveGeneric,
Extension
LangExt.DeriveLift,
Extension
LangExt.DeriveTraversable,
Extension
LangExt.EmptyCase,
Extension
LangExt.EmptyDataDeriving,
Extension
LangExt.ExistentialQuantification,
Extension
LangExt.ExplicitForAll,
Extension
LangExt.FlexibleContexts,
Extension
LangExt.FlexibleInstances,
Extension
LangExt.GADTSyntax,
Extension
LangExt.GeneralizedNewtypeDeriving,
Extension
LangExt.HexFloatLiterals,
Extension
LangExt.ImportQualifiedPost,
Extension
LangExt.InstanceSigs,
Extension
LangExt.KindSignatures,
Extension
LangExt.MultiParamTypeClasses,
Extension
LangExt.NamedFieldPuns,
Extension
LangExt.NamedWildCards,
Extension
LangExt.NumericUnderscores,
Extension
LangExt.PolyKinds,
Extension
LangExt.PostfixOperators,
Extension
LangExt.RankNTypes,
Extension
LangExt.ScopedTypeVariables,
Extension
LangExt.StandaloneDeriving,
Extension
LangExt.StandaloneKindSignatures,
Extension
LangExt.TupleSections,
Extension
LangExt.TypeApplications,
Extension
LangExt.TypeOperators,
Extension
LangExt.TypeSynonymInstances]
hasPprDebug :: DynFlags -> Bool
hasPprDebug :: DynFlags -> Bool
hasPprDebug = DumpFlag -> DynFlags -> Bool
dopt DumpFlag
Opt_D_ppr_debug
hasNoDebugOutput :: DynFlags -> Bool
hasNoDebugOutput :: DynFlags -> Bool
hasNoDebugOutput = DumpFlag -> DynFlags -> Bool
dopt DumpFlag
Opt_D_no_debug_output
hasNoStateHack :: DynFlags -> Bool
hasNoStateHack :: DynFlags -> Bool
hasNoStateHack = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_G_NoStateHack
hasNoOptCoercion :: DynFlags -> Bool
hasNoOptCoercion :: DynFlags -> Bool
hasNoOptCoercion = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_G_NoOptCoercion
dopt :: DumpFlag -> DynFlags -> Bool
dopt :: DumpFlag -> DynFlags -> Bool
dopt DumpFlag
f DynFlags
dflags = (DumpFlag
f DumpFlag -> EnumSet DumpFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet DumpFlag
dumpFlags DynFlags
dflags)
Bool -> Bool -> Bool
|| (DynFlags -> Int
verbosity DynFlags
dflags Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
4 Bool -> Bool -> Bool
&& DumpFlag -> Bool
enableIfVerbose DumpFlag
f)
where enableIfVerbose :: DumpFlag -> Bool
enableIfVerbose DumpFlag
Opt_D_dump_tc_trace = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rn_trace = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_cs_trace = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_if_trace = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_tc = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rn = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rn_stats = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_hi_diffs = Bool
False
enableIfVerbose DumpFlag
Opt_D_verbose_core2core = Bool
False
enableIfVerbose DumpFlag
Opt_D_verbose_stg2stg = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_splices = Bool
False
enableIfVerbose DumpFlag
Opt_D_th_dec_file = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rule_firings = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rule_rewrites = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_simpl_trace = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_rtti = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_inlinings = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_verbose_inlinings = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_core_stats = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_asm_stats = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_types = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_simpl_iterations = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_ticked = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_view_pattern_commoning = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_mod_cycles = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_mod_map = Bool
False
enableIfVerbose DumpFlag
Opt_D_dump_ec_trace = Bool
False
enableIfVerbose DumpFlag
_ = Bool
True
dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set DynFlags
dfs DumpFlag
f = DynFlags
dfs{ dumpFlags :: EnumSet DumpFlag
dumpFlags = DumpFlag -> EnumSet DumpFlag -> EnumSet DumpFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.insert DumpFlag
f (DynFlags -> EnumSet DumpFlag
dumpFlags DynFlags
dfs) }
dopt_unset :: DynFlags -> DumpFlag -> DynFlags
dopt_unset :: DynFlags -> DumpFlag -> DynFlags
dopt_unset DynFlags
dfs DumpFlag
f = DynFlags
dfs{ dumpFlags :: EnumSet DumpFlag
dumpFlags = DumpFlag -> EnumSet DumpFlag -> EnumSet DumpFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.delete DumpFlag
f (DynFlags -> EnumSet DumpFlag
dumpFlags DynFlags
dfs) }
gopt :: GeneralFlag -> DynFlags -> Bool
gopt :: GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = Bool
True
gopt GeneralFlag
Opt_ExternalDynamicRefs DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = Bool
True
gopt GeneralFlag
Opt_SplitSections DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = Bool
False
gopt GeneralFlag
f DynFlags
dflags = GeneralFlag
f GeneralFlag -> EnumSet GeneralFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
dflags
gopt_set :: DynFlags -> GeneralFlag -> DynFlags
gopt_set :: DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dfs GeneralFlag
f = DynFlags
dfs{ generalFlags :: EnumSet GeneralFlag
generalFlags = GeneralFlag -> EnumSet GeneralFlag -> EnumSet GeneralFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.insert GeneralFlag
f (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
dfs) }
gopt_unset :: DynFlags -> GeneralFlag -> DynFlags
gopt_unset :: DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dfs GeneralFlag
f = DynFlags
dfs{ generalFlags :: EnumSet GeneralFlag
generalFlags = GeneralFlag -> EnumSet GeneralFlag -> EnumSet GeneralFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.delete GeneralFlag
f (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
dfs) }
wopt :: WarningFlag -> DynFlags -> Bool
wopt :: WarningFlag -> DynFlags -> Bool
wopt WarningFlag
f DynFlags
dflags = WarningFlag
f WarningFlag -> EnumSet WarningFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet WarningFlag
warningFlags DynFlags
dflags
wopt_set :: DynFlags -> WarningFlag -> DynFlags
wopt_set :: DynFlags -> WarningFlag -> DynFlags
wopt_set DynFlags
dfs WarningFlag
f = DynFlags
dfs{ warningFlags :: EnumSet WarningFlag
warningFlags = WarningFlag -> EnumSet WarningFlag -> EnumSet WarningFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.insert WarningFlag
f (DynFlags -> EnumSet WarningFlag
warningFlags DynFlags
dfs) }
wopt_unset :: DynFlags -> WarningFlag -> DynFlags
wopt_unset :: DynFlags -> WarningFlag -> DynFlags
wopt_unset DynFlags
dfs WarningFlag
f = DynFlags
dfs{ warningFlags :: EnumSet WarningFlag
warningFlags = WarningFlag -> EnumSet WarningFlag -> EnumSet WarningFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.delete WarningFlag
f (DynFlags -> EnumSet WarningFlag
warningFlags DynFlags
dfs) }
wopt_fatal :: WarningFlag -> DynFlags -> Bool
wopt_fatal :: WarningFlag -> DynFlags -> Bool
wopt_fatal WarningFlag
f DynFlags
dflags = WarningFlag
f WarningFlag -> EnumSet WarningFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet WarningFlag
fatalWarningFlags DynFlags
dflags
wopt_set_fatal :: DynFlags -> WarningFlag -> DynFlags
wopt_set_fatal :: DynFlags -> WarningFlag -> DynFlags
wopt_set_fatal DynFlags
dfs WarningFlag
f
= DynFlags
dfs { fatalWarningFlags :: EnumSet WarningFlag
fatalWarningFlags = WarningFlag -> EnumSet WarningFlag -> EnumSet WarningFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.insert WarningFlag
f (DynFlags -> EnumSet WarningFlag
fatalWarningFlags DynFlags
dfs) }
wopt_unset_fatal :: DynFlags -> WarningFlag -> DynFlags
wopt_unset_fatal :: DynFlags -> WarningFlag -> DynFlags
wopt_unset_fatal DynFlags
dfs WarningFlag
f
= DynFlags
dfs { fatalWarningFlags :: EnumSet WarningFlag
fatalWarningFlags = WarningFlag -> EnumSet WarningFlag -> EnumSet WarningFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
EnumSet.delete WarningFlag
f (DynFlags -> EnumSet WarningFlag
fatalWarningFlags DynFlags
dfs) }
xopt :: LangExt.Extension -> DynFlags -> Bool
xopt :: Extension -> DynFlags -> Bool
xopt Extension
f DynFlags
dflags = Extension
f Extension -> EnumSet Extension -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet Extension
extensionFlags DynFlags
dflags
xopt_set :: DynFlags -> LangExt.Extension -> DynFlags
xopt_set :: DynFlags -> Extension -> DynFlags
xopt_set DynFlags
dfs Extension
f
= let onoffs :: [OnOff Extension]
onoffs = Extension -> OnOff Extension
forall a. a -> OnOff a
On Extension
f OnOff Extension -> [OnOff Extension] -> [OnOff Extension]
forall a. a -> [a] -> [a]
: DynFlags -> [OnOff Extension]
extensions DynFlags
dfs
in DynFlags
dfs { extensions :: [OnOff Extension]
extensions = [OnOff Extension]
onoffs,
extensionFlags :: EnumSet Extension
extensionFlags = Maybe Language -> [OnOff Extension] -> EnumSet Extension
flattenExtensionFlags (DynFlags -> Maybe Language
language DynFlags
dfs) [OnOff Extension]
onoffs }
xopt_unset :: DynFlags -> LangExt.Extension -> DynFlags
xopt_unset :: DynFlags -> Extension -> DynFlags
xopt_unset DynFlags
dfs Extension
f
= let onoffs :: [OnOff Extension]
onoffs = Extension -> OnOff Extension
forall a. a -> OnOff a
Off Extension
f OnOff Extension -> [OnOff Extension] -> [OnOff Extension]
forall a. a -> [a] -> [a]
: DynFlags -> [OnOff Extension]
extensions DynFlags
dfs
in DynFlags
dfs { extensions :: [OnOff Extension]
extensions = [OnOff Extension]
onoffs,
extensionFlags :: EnumSet Extension
extensionFlags = Maybe Language -> [OnOff Extension] -> EnumSet Extension
flattenExtensionFlags (DynFlags -> Maybe Language
language DynFlags
dfs) [OnOff Extension]
onoffs }
xopt_set_unlessExplSpec
:: LangExt.Extension
-> (DynFlags -> LangExt.Extension -> DynFlags)
-> DynFlags -> DynFlags
xopt_set_unlessExplSpec :: Extension
-> (DynFlags -> Extension -> DynFlags) -> DynFlags -> DynFlags
xopt_set_unlessExplSpec Extension
ext DynFlags -> Extension -> DynFlags
setUnset DynFlags
dflags =
let referedExts :: [Extension]
referedExts = OnOff Extension -> Extension
forall p. OnOff p -> p
stripOnOff (OnOff Extension -> Extension) -> [OnOff Extension] -> [Extension]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DynFlags -> [OnOff Extension]
extensions DynFlags
dflags
stripOnOff :: OnOff p -> p
stripOnOff (On p
x) = p
x
stripOnOff (Off p
x) = p
x
in
if Extension
ext Extension -> [Extension] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Extension]
referedExts then DynFlags
dflags else DynFlags -> Extension -> DynFlags
setUnset DynFlags
dflags Extension
ext
xopt_DuplicateRecordFields :: DynFlags -> FieldLabel.DuplicateRecordFields
xopt_DuplicateRecordFields :: DynFlags -> DuplicateRecordFields
xopt_DuplicateRecordFields DynFlags
dfs
| Extension -> DynFlags -> Bool
xopt Extension
LangExt.DuplicateRecordFields DynFlags
dfs = DuplicateRecordFields
FieldLabel.DuplicateRecordFields
| Bool
otherwise = DuplicateRecordFields
FieldLabel.NoDuplicateRecordFields
xopt_FieldSelectors :: DynFlags -> FieldLabel.FieldSelectors
xopt_FieldSelectors :: DynFlags -> FieldSelectors
xopt_FieldSelectors DynFlags
dfs
| Extension -> DynFlags -> Bool
xopt Extension
LangExt.FieldSelectors DynFlags
dfs = FieldSelectors
FieldLabel.FieldSelectors
| Bool
otherwise = FieldSelectors
FieldLabel.NoFieldSelectors
lang_set :: DynFlags -> Maybe Language -> DynFlags
lang_set :: DynFlags -> Maybe Language -> DynFlags
lang_set DynFlags
dflags Maybe Language
lang =
DynFlags
dflags {
language :: Maybe Language
language = Maybe Language
lang,
extensionFlags :: EnumSet Extension
extensionFlags = Maybe Language -> [OnOff Extension] -> EnumSet Extension
flattenExtensionFlags Maybe Language
lang (DynFlags -> [OnOff Extension]
extensions DynFlags
dflags)
}
setLanguage :: Language -> DynP ()
setLanguage :: Language -> DynP ()
setLanguage Language
l = (DynFlags -> DynFlags) -> DynP ()
upd (DynFlags -> Maybe Language -> DynFlags
`lang_set` Language -> Maybe Language
forall a. a -> Maybe a
Just Language
l)
packageTrustOn :: DynFlags -> Bool
packageTrustOn :: DynFlags -> Bool
packageTrustOn = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PackageTrust
safeHaskellOn :: DynFlags -> Bool
safeHaskellOn :: DynFlags -> Bool
safeHaskellOn DynFlags
dflags = DynFlags -> Bool
safeHaskellModeEnabled DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
safeInferOn DynFlags
dflags
safeHaskellModeEnabled :: DynFlags -> Bool
safeHaskellModeEnabled :: DynFlags -> Bool
safeHaskellModeEnabled DynFlags
dflags = DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dflags SafeHaskellMode -> [SafeHaskellMode] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [SafeHaskellMode
Sf_Unsafe, SafeHaskellMode
Sf_Trustworthy
, SafeHaskellMode
Sf_Safe ]
safeLanguageOn :: DynFlags -> Bool
safeLanguageOn :: DynFlags -> Bool
safeLanguageOn DynFlags
dflags = DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dflags SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Safe
safeInferOn :: DynFlags -> Bool
safeInferOn :: DynFlags -> Bool
safeInferOn = DynFlags -> Bool
safeInfer
safeImportsOn :: DynFlags -> Bool
safeImportsOn :: DynFlags -> Bool
safeImportsOn DynFlags
dflags = DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dflags SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Unsafe Bool -> Bool -> Bool
||
DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dflags SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Trustworthy Bool -> Bool -> Bool
||
DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dflags SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Safe
setSafeHaskell :: SafeHaskellMode -> DynP ()
setSafeHaskell :: SafeHaskellMode -> DynP ()
setSafeHaskell SafeHaskellMode
s = (DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
f
where f :: DynFlags -> DynP DynFlags
f DynFlags
dfs = do
let sf :: SafeHaskellMode
sf = DynFlags -> SafeHaskellMode
safeHaskell DynFlags
dfs
SafeHaskellMode
safeM <- SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
combineSafeFlags SafeHaskellMode
sf SafeHaskellMode
s
case SafeHaskellMode
s of
SafeHaskellMode
Sf_Safe -> DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dfs { safeHaskell :: SafeHaskellMode
safeHaskell = SafeHaskellMode
safeM, safeInfer :: Bool
safeInfer = Bool
False }
SafeHaskellMode
Sf_Trustworthy -> do
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dfs { safeHaskell :: SafeHaskellMode
safeHaskell = SafeHaskellMode
safeM, trustworthyOnLoc :: SrcSpan
trustworthyOnLoc = SrcSpan
l }
SafeHaskellMode
_ -> DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dfs { safeHaskell :: SafeHaskellMode
safeHaskell = SafeHaskellMode
safeM }
safeDirectImpsReq :: DynFlags -> Bool
safeDirectImpsReq :: DynFlags -> Bool
safeDirectImpsReq DynFlags
d = DynFlags -> Bool
safeLanguageOn DynFlags
d
safeImplicitImpsReq :: DynFlags -> Bool
safeImplicitImpsReq :: DynFlags -> Bool
safeImplicitImpsReq DynFlags
d = DynFlags -> Bool
safeLanguageOn DynFlags
d
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
combineSafeFlags SafeHaskellMode
a SafeHaskellMode
b | SafeHaskellMode
a SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_None = SafeHaskellMode -> DynP SafeHaskellMode
forall (m :: * -> *) a. Monad m => a -> m a
return SafeHaskellMode
b
| SafeHaskellMode
b SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_None = SafeHaskellMode -> DynP SafeHaskellMode
forall (m :: * -> *) a. Monad m => a -> m a
return SafeHaskellMode
a
| SafeHaskellMode
a SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Ignore Bool -> Bool -> Bool
|| SafeHaskellMode
b SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
Sf_Ignore = SafeHaskellMode -> DynP SafeHaskellMode
forall (m :: * -> *) a. Monad m => a -> m a
return SafeHaskellMode
Sf_Ignore
| SafeHaskellMode
a SafeHaskellMode -> SafeHaskellMode -> Bool
forall a. Eq a => a -> a -> Bool
== SafeHaskellMode
b = SafeHaskellMode -> DynP SafeHaskellMode
forall (m :: * -> *) a. Monad m => a -> m a
return SafeHaskellMode
a
| Bool
otherwise = String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addErr String
errm DynP () -> DynP SafeHaskellMode -> DynP SafeHaskellMode
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> SafeHaskellMode -> DynP SafeHaskellMode
forall (f :: * -> *) a. Applicative f => a -> f a
pure SafeHaskellMode
a
where errm :: String
errm = String
"Incompatible Safe Haskell flags! ("
String -> ShowS
forall a. [a] -> [a] -> [a]
++ SafeHaskellMode -> String
forall a. Show a => a -> String
show SafeHaskellMode
a String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
", " String -> ShowS
forall a. [a] -> [a] -> [a]
++ SafeHaskellMode -> String
forall a. Show a => a -> String
show SafeHaskellMode
b String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
unsafeFlags, unsafeFlagsForInfer
:: [(String, DynFlags -> SrcSpan, DynFlags -> Bool, DynFlags -> DynFlags)]
unsafeFlags :: [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlags = [ (String
"-XGeneralizedNewtypeDeriving", DynFlags -> SrcSpan
newDerivOnLoc,
Extension -> DynFlags -> Bool
xopt Extension
LangExt.GeneralizedNewtypeDeriving,
(DynFlags -> Extension -> DynFlags)
-> Extension -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> Extension -> DynFlags
xopt_unset Extension
LangExt.GeneralizedNewtypeDeriving)
, (String
"-XDerivingVia", DynFlags -> SrcSpan
deriveViaOnLoc,
Extension -> DynFlags -> Bool
xopt Extension
LangExt.DerivingVia,
(DynFlags -> Extension -> DynFlags)
-> Extension -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> Extension -> DynFlags
xopt_unset Extension
LangExt.DerivingVia)
, (String
"-XTemplateHaskell", DynFlags -> SrcSpan
thOnLoc,
Extension -> DynFlags -> Bool
xopt Extension
LangExt.TemplateHaskell,
(DynFlags -> Extension -> DynFlags)
-> Extension -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> Extension -> DynFlags
xopt_unset Extension
LangExt.TemplateHaskell)
]
unsafeFlagsForInfer :: [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlagsForInfer = [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlags
getOpts :: DynFlags
-> (DynFlags -> [a])
-> [a]
getOpts :: DynFlags -> (DynFlags -> [a]) -> [a]
getOpts DynFlags
dflags DynFlags -> [a]
opts = [a] -> [a]
forall a. [a] -> [a]
reverse (DynFlags -> [a]
opts DynFlags
dflags)
getVerbFlags :: DynFlags -> [String]
getVerbFlags :: DynFlags -> [String]
getVerbFlags DynFlags
dflags
| DynFlags -> Int
verbosity DynFlags
dflags Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
4 = [String
"-v"]
| Bool
otherwise = []
setObjectDir, setHiDir, setHieDir, setStubDir, setDumpDir, setOutputDir,
setDynObjectSuf, setDynHiSuf,
setDylibInstallName,
setObjectSuf, setHiSuf, setHieSuf, setHcSuf, parseDynLibLoaderMode,
setPgmP, addOptl, addOptc, addOptcxx, addOptP,
addCmdlineFramework, addHaddockOpts, addGhciScript,
setInteractivePrint
:: String -> DynFlags -> DynFlags
setOutputFile, setDynOutputFile, setOutputHi, setDynOutputHi, setDumpPrefixForce
:: Maybe String -> DynFlags -> DynFlags
setObjectDir :: String -> DynFlags -> DynFlags
setObjectDir String
f DynFlags
d = DynFlags
d { objectDir :: Maybe String
objectDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setHiDir :: String -> DynFlags -> DynFlags
setHiDir String
f DynFlags
d = DynFlags
d { hiDir :: Maybe String
hiDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setHieDir :: String -> DynFlags -> DynFlags
setHieDir String
f DynFlags
d = DynFlags
d { hieDir :: Maybe String
hieDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setStubDir :: String -> DynFlags -> DynFlags
setStubDir String
f DynFlags
d = DynFlags
d { stubDir :: Maybe String
stubDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f
, includePaths :: IncludeSpecs
includePaths = IncludeSpecs -> [String] -> IncludeSpecs
addGlobalInclude (DynFlags -> IncludeSpecs
includePaths DynFlags
d) [String
f] }
setDumpDir :: String -> DynFlags -> DynFlags
setDumpDir String
f DynFlags
d = DynFlags
d { dumpDir :: Maybe String
dumpDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setOutputDir :: String -> DynFlags -> DynFlags
setOutputDir String
f = String -> DynFlags -> DynFlags
setObjectDir String
f
(DynFlags -> DynFlags)
-> (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
setHieDir String
f
(DynFlags -> DynFlags)
-> (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
setHiDir String
f
(DynFlags -> DynFlags)
-> (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
setStubDir String
f
(DynFlags -> DynFlags)
-> (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
setDumpDir String
f
setDylibInstallName :: String -> DynFlags -> DynFlags
setDylibInstallName String
f DynFlags
d = DynFlags
d { dylibInstallName :: Maybe String
dylibInstallName = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setObjectSuf :: String -> DynFlags -> DynFlags
setObjectSuf String
f DynFlags
d = DynFlags
d { objectSuf_ :: String
objectSuf_ = String
f}
setDynObjectSuf :: String -> DynFlags -> DynFlags
setDynObjectSuf String
f DynFlags
d = DynFlags
d { dynObjectSuf_ :: String
dynObjectSuf_ = String
f}
setHiSuf :: String -> DynFlags -> DynFlags
setHiSuf String
f DynFlags
d = DynFlags
d { hiSuf_ :: String
hiSuf_ = String
f}
setHieSuf :: String -> DynFlags -> DynFlags
setHieSuf String
f DynFlags
d = DynFlags
d { hieSuf :: String
hieSuf = String
f}
setDynHiSuf :: String -> DynFlags -> DynFlags
setDynHiSuf String
f DynFlags
d = DynFlags
d { dynHiSuf_ :: String
dynHiSuf_ = String
f}
setHcSuf :: String -> DynFlags -> DynFlags
setHcSuf String
f DynFlags
d = DynFlags
d { hcSuf :: String
hcSuf = String
f}
setOutputFile :: Maybe String -> DynFlags -> DynFlags
setOutputFile Maybe String
f DynFlags
d = DynFlags
d { outputFile_ :: Maybe String
outputFile_ = Maybe String
f}
setDynOutputFile :: Maybe String -> DynFlags -> DynFlags
setDynOutputFile Maybe String
f DynFlags
d = DynFlags
d { dynOutputFile_ :: Maybe String
dynOutputFile_ = Maybe String
f}
setOutputHi :: Maybe String -> DynFlags -> DynFlags
setOutputHi Maybe String
f DynFlags
d = DynFlags
d { outputHi :: Maybe String
outputHi = Maybe String
f}
setDynOutputHi :: Maybe String -> DynFlags -> DynFlags
setDynOutputHi Maybe String
f DynFlags
d = DynFlags
d { dynOutputHi :: Maybe String
dynOutputHi = Maybe String
f}
parseUnitInsts :: String -> Instantiations
parseUnitInsts :: String -> [(ModuleName, Module)]
parseUnitInsts String
str = case (([(ModuleName, Module)], String) -> Bool)
-> [([(ModuleName, Module)], String)]
-> [([(ModuleName, Module)], String)]
forall a. (a -> Bool) -> [a] -> [a]
filter ((String -> String -> Bool
forall a. Eq a => a -> a -> Bool
==String
"")(String -> Bool)
-> (([(ModuleName, Module)], String) -> String)
-> ([(ModuleName, Module)], String)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.([(ModuleName, Module)], String) -> String
forall a b. (a, b) -> b
snd) (ReadP [(ModuleName, Module)] -> ReadS [(ModuleName, Module)]
forall a. ReadP a -> ReadS a
readP_to_S ReadP [(ModuleName, Module)]
parse String
str) of
[([(ModuleName, Module)]
r, String
"")] -> [(ModuleName, Module)]
r
[([(ModuleName, Module)], String)]
_ -> GhcException -> [(ModuleName, Module)]
forall a. GhcException -> a
throwGhcException (GhcException -> [(ModuleName, Module)])
-> GhcException -> [(ModuleName, Module)]
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError (String
"Can't parse -instantiated-with: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str)
where parse :: ReadP [(ModuleName, Module)]
parse = ReadP (ModuleName, Module)
-> ReadP Char -> ReadP [(ModuleName, Module)]
forall a sep. ReadP a -> ReadP sep -> ReadP [a]
sepBy ReadP (ModuleName, Module)
parseEntry (Char -> ReadP Char
R.char Char
',')
parseEntry :: ReadP (ModuleName, Module)
parseEntry = do
ModuleName
n <- ReadP ModuleName
parseModuleName
Char
_ <- Char -> ReadP Char
R.char Char
'='
Module
m <- ReadP Module
parseHoleyModule
(ModuleName, Module) -> ReadP (ModuleName, Module)
forall (m :: * -> *) a. Monad m => a -> m a
return (ModuleName
n, Module
m)
setUnitInstantiations :: String -> DynFlags -> DynFlags
setUnitInstantiations :: String -> DynFlags -> DynFlags
setUnitInstantiations String
s DynFlags
d =
DynFlags
d { homeUnitInstantiations_ :: [(ModuleName, Module)]
homeUnitInstantiations_ = String -> [(ModuleName, Module)]
parseUnitInsts String
s }
setUnitInstanceOf :: String -> DynFlags -> DynFlags
setUnitInstanceOf :: String -> DynFlags -> DynFlags
setUnitInstanceOf String
s DynFlags
d =
DynFlags
d { homeUnitInstanceOf_ :: Maybe UnitId
homeUnitInstanceOf_ = UnitId -> Maybe UnitId
forall a. a -> Maybe a
Just (FastString -> UnitId
UnitId (String -> FastString
fsLit String
s)) }
addPluginModuleName :: String -> DynFlags -> DynFlags
addPluginModuleName :: String -> DynFlags -> DynFlags
addPluginModuleName String
name DynFlags
d = DynFlags
d { pluginModNames :: [ModuleName]
pluginModNames = (String -> ModuleName
mkModuleName String
name) ModuleName -> [ModuleName] -> [ModuleName]
forall a. a -> [a] -> [a]
: (DynFlags -> [ModuleName]
pluginModNames DynFlags
d) }
clearPluginModuleNames :: DynFlags -> DynFlags
clearPluginModuleNames :: DynFlags -> DynFlags
clearPluginModuleNames DynFlags
d =
DynFlags
d { pluginModNames :: [ModuleName]
pluginModNames = []
, pluginModNameOpts :: [(ModuleName, String)]
pluginModNameOpts = []
}
addPluginModuleNameOption :: String -> DynFlags -> DynFlags
addPluginModuleNameOption :: String -> DynFlags -> DynFlags
addPluginModuleNameOption String
optflag DynFlags
d = DynFlags
d { pluginModNameOpts :: [(ModuleName, String)]
pluginModNameOpts = (String -> ModuleName
mkModuleName String
m, String
option) (ModuleName, String)
-> [(ModuleName, String)] -> [(ModuleName, String)]
forall a. a -> [a] -> [a]
: (DynFlags -> [(ModuleName, String)]
pluginModNameOpts DynFlags
d) }
where (String
m, String
rest) = (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
':') String
optflag
option :: String
option = case String
rest of
[] -> String
""
(Char
_:String
plug_opt) -> String
plug_opt
addFrontendPluginOption :: String -> DynFlags -> DynFlags
addFrontendPluginOption :: String -> DynFlags -> DynFlags
addFrontendPluginOption String
s DynFlags
d = DynFlags
d { frontendPluginOpts :: [String]
frontendPluginOpts = String
s String -> [String] -> [String]
forall a. a -> [a] -> [a]
: DynFlags -> [String]
frontendPluginOpts DynFlags
d }
parseDynLibLoaderMode :: String -> DynFlags -> DynFlags
parseDynLibLoaderMode String
f DynFlags
d =
case Int -> String -> (String, String)
forall a. Int -> [a] -> ([a], [a])
splitAt Int
8 String
f of
(String
"deploy", String
"") -> DynFlags
d { dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
Deployable }
(String
"sysdep", String
"") -> DynFlags
d { dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
SystemDependent }
(String, String)
_ -> GhcException -> DynFlags
forall a. GhcException -> a
throwGhcException (String -> GhcException
CmdLineError (String
"Unknown dynlib loader: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
f))
setDumpPrefixForce :: Maybe String -> DynFlags -> DynFlags
setDumpPrefixForce Maybe String
f DynFlags
d = DynFlags
d { dumpPrefixForce :: Maybe String
dumpPrefixForce = Maybe String
f}
setPgmP :: String -> DynFlags -> DynFlags
setPgmP String
f = (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings (\ToolSettings
s -> ToolSettings
s { toolSettings_pgm_P :: (String, [Option])
toolSettings_pgm_P = (String
pgm, (String -> Option) -> [String] -> [Option]
forall a b. (a -> b) -> [a] -> [b]
map String -> Option
Option [String]
args)})
where (String
pgm:[String]
args) = String -> [String]
words String
f
addOptl :: String -> DynFlags -> DynFlags
addOptl String
f = (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings (\ToolSettings
s -> ToolSettings
s { toolSettings_opt_l :: [String]
toolSettings_opt_l = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_l ToolSettings
s})
addOptc :: String -> DynFlags -> DynFlags
addOptc String
f = (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings (\ToolSettings
s -> ToolSettings
s { toolSettings_opt_c :: [String]
toolSettings_opt_c = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_c ToolSettings
s})
addOptcxx :: String -> DynFlags -> DynFlags
addOptcxx String
f = (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings (\ToolSettings
s -> ToolSettings
s { toolSettings_opt_cxx :: [String]
toolSettings_opt_cxx = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_cxx ToolSettings
s})
addOptP :: String -> DynFlags -> DynFlags
addOptP String
f = (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s
{ toolSettings_opt_P :: [String]
toolSettings_opt_P = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_P ToolSettings
s
, toolSettings_opt_P_fingerprint :: Fingerprint
toolSettings_opt_P_fingerprint = [String] -> Fingerprint
fingerprintStrings (String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_P ToolSettings
s)
}
where
fingerprintStrings :: [String] -> Fingerprint
fingerprintStrings [String]
ss = [Fingerprint] -> Fingerprint
fingerprintFingerprints ([Fingerprint] -> Fingerprint) -> [Fingerprint] -> Fingerprint
forall a b. (a -> b) -> a -> b
$ (String -> Fingerprint) -> [String] -> [Fingerprint]
forall a b. (a -> b) -> [a] -> [b]
map String -> Fingerprint
fingerprintString [String]
ss
setDepMakefile :: FilePath -> DynFlags -> DynFlags
setDepMakefile :: String -> DynFlags -> DynFlags
setDepMakefile String
f DynFlags
d = DynFlags
d { depMakefile :: String
depMakefile = String
f }
setDepIncludeCppDeps :: Bool -> DynFlags -> DynFlags
setDepIncludeCppDeps :: Bool -> DynFlags -> DynFlags
setDepIncludeCppDeps Bool
b DynFlags
d = DynFlags
d { depIncludeCppDeps :: Bool
depIncludeCppDeps = Bool
b }
setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps Bool
b DynFlags
d = DynFlags
d { depIncludePkgDeps :: Bool
depIncludePkgDeps = Bool
b }
addDepExcludeMod :: String -> DynFlags -> DynFlags
addDepExcludeMod :: String -> DynFlags -> DynFlags
addDepExcludeMod String
m DynFlags
d
= DynFlags
d { depExcludeMods :: [ModuleName]
depExcludeMods = String -> ModuleName
mkModuleName String
m ModuleName -> [ModuleName] -> [ModuleName]
forall a. a -> [a] -> [a]
: DynFlags -> [ModuleName]
depExcludeMods DynFlags
d }
addDepSuffix :: FilePath -> DynFlags -> DynFlags
addDepSuffix :: String -> DynFlags -> DynFlags
addDepSuffix String
s DynFlags
d = DynFlags
d { depSuffixes :: [String]
depSuffixes = String
s String -> [String] -> [String]
forall a. a -> [a] -> [a]
: DynFlags -> [String]
depSuffixes DynFlags
d }
addCmdlineFramework :: String -> DynFlags -> DynFlags
addCmdlineFramework String
f DynFlags
d = DynFlags
d { cmdlineFrameworks :: [String]
cmdlineFrameworks = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: DynFlags -> [String]
cmdlineFrameworks DynFlags
d}
addGhcVersionFile :: FilePath -> DynFlags -> DynFlags
addGhcVersionFile :: String -> DynFlags -> DynFlags
addGhcVersionFile String
f DynFlags
d = DynFlags
d { ghcVersionFile :: Maybe String
ghcVersionFile = String -> Maybe String
forall a. a -> Maybe a
Just String
f }
addHaddockOpts :: String -> DynFlags -> DynFlags
addHaddockOpts String
f DynFlags
d = DynFlags
d { haddockOptions :: Maybe String
haddockOptions = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
addGhciScript :: String -> DynFlags -> DynFlags
addGhciScript String
f DynFlags
d = DynFlags
d { ghciScripts :: [String]
ghciScripts = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: DynFlags -> [String]
ghciScripts DynFlags
d}
setInteractivePrint :: String -> DynFlags -> DynFlags
setInteractivePrint String
f DynFlags
d = DynFlags
d { interactivePrint :: Maybe String
interactivePrint = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
updOptLevelChanged :: Int -> DynFlags -> (DynFlags, Bool)
updOptLevelChanged :: Int -> DynFlags -> (DynFlags, Bool)
updOptLevelChanged Int
n DynFlags
dfs
= (DynFlags
dfs3, Bool
changed1 Bool -> Bool -> Bool
|| Bool
changed2 Bool -> Bool -> Bool
|| Bool
changed3)
where
final_n :: Int
final_n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 (Int -> Int -> Int
forall a. Ord a => a -> a -> a
min Int
2 Int
n)
(DynFlags
dfs1, Bool
changed1) = (GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool))
-> (DynFlags, Bool) -> [GeneralFlag] -> (DynFlags, Bool)
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool)
unset (DynFlags
dfs , Bool
False) [GeneralFlag]
remove_gopts
(DynFlags
dfs2, Bool
changed2) = (GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool))
-> (DynFlags, Bool) -> [GeneralFlag] -> (DynFlags, Bool)
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool)
set (DynFlags
dfs1, Bool
False) [GeneralFlag]
extra_gopts
(DynFlags
dfs3, Bool
changed3) = DynFlags -> (DynFlags, Bool)
setLlvmOptLevel DynFlags
dfs2
extra_gopts :: [GeneralFlag]
extra_gopts = [ GeneralFlag
f | ([Int]
ns,GeneralFlag
f) <- [([Int], GeneralFlag)]
optLevelFlags, Int
final_n Int -> [Int] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Int]
ns ]
remove_gopts :: [GeneralFlag]
remove_gopts = [ GeneralFlag
f | ([Int]
ns,GeneralFlag
f) <- [([Int], GeneralFlag)]
optLevelFlags, Int
final_n Int -> [Int] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [Int]
ns ]
set :: GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool)
set GeneralFlag
f (DynFlags
dfs, Bool
changed)
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
f DynFlags
dfs = (DynFlags
dfs, Bool
changed)
| Bool
otherwise = (DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dfs GeneralFlag
f, Bool
True)
unset :: GeneralFlag -> (DynFlags, Bool) -> (DynFlags, Bool)
unset GeneralFlag
f (DynFlags
dfs, Bool
changed)
| Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
f DynFlags
dfs) = (DynFlags
dfs, Bool
changed)
| Bool
otherwise = (DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dfs GeneralFlag
f, Bool
True)
setLlvmOptLevel :: DynFlags -> (DynFlags, Bool)
setLlvmOptLevel DynFlags
dfs
| DynFlags -> Int
llvmOptLevel DynFlags
dfs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
final_n = (DynFlags
dfs{ llvmOptLevel :: Int
llvmOptLevel = Int
final_n }, Bool
True)
| Bool
otherwise = (DynFlags
dfs, Bool
False)
updOptLevel :: Int -> DynFlags -> DynFlags
updOptLevel :: Int -> DynFlags -> DynFlags
updOptLevel Int
n = (DynFlags, Bool) -> DynFlags
forall a b. (a, b) -> a
fst ((DynFlags, Bool) -> DynFlags)
-> (DynFlags -> (DynFlags, Bool)) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> DynFlags -> (DynFlags, Bool)
updOptLevelChanged Int
n
parseDynamicFlagsCmdLine :: MonadIO m => DynFlags -> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsCmdLine :: DynFlags
-> [Located String] -> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsCmdLine = [Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
forall (m :: * -> *).
MonadIO m =>
[Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsFull [Flag (CmdLineP DynFlags)]
flagsAll Bool
True
parseDynamicFilePragma :: MonadIO m => DynFlags -> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFilePragma :: DynFlags
-> [Located String] -> m (DynFlags, [Located String], [Warn])
parseDynamicFilePragma = [Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
forall (m :: * -> *).
MonadIO m =>
[Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsFull [Flag (CmdLineP DynFlags)]
flagsDynamic Bool
False
newtype CmdLineP s a = CmdLineP (forall m. (Monad m) => StateT s m a)
instance Monad (CmdLineP s) where
CmdLineP forall (m :: * -> *). Monad m => StateT s m a
k >>= :: CmdLineP s a -> (a -> CmdLineP s b) -> CmdLineP s b
>>= a -> CmdLineP s b
f = (forall (m :: * -> *). Monad m => StateT s m b) -> CmdLineP s b
forall s a.
(forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
CmdLineP (StateT s m a
forall (m :: * -> *). Monad m => StateT s m a
k StateT s m a -> (a -> StateT s m b) -> StateT s m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a
x -> case a -> CmdLineP s b
f a
x of CmdLineP forall (m :: * -> *). Monad m => StateT s m b
g -> StateT s m b
forall (m :: * -> *). Monad m => StateT s m b
g)
return :: a -> CmdLineP s a
return = a -> CmdLineP s a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
instance Applicative (CmdLineP s) where
pure :: a -> CmdLineP s a
pure a
x = (forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
forall s a.
(forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
CmdLineP (a -> StateT s m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
x)
<*> :: CmdLineP s (a -> b) -> CmdLineP s a -> CmdLineP s b
(<*>) = CmdLineP s (a -> b) -> CmdLineP s a -> CmdLineP s b
forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap
instance Functor (CmdLineP s) where
fmap :: (a -> b) -> CmdLineP s a -> CmdLineP s b
fmap a -> b
f (CmdLineP forall (m :: * -> *). Monad m => StateT s m a
k) = (forall (m :: * -> *). Monad m => StateT s m b) -> CmdLineP s b
forall s a.
(forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
CmdLineP ((a -> b) -> StateT s m a -> StateT s m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f StateT s m a
forall (m :: * -> *). Monad m => StateT s m a
k)
getCmdLineState :: CmdLineP s s
getCmdLineState :: CmdLineP s s
getCmdLineState = (forall (m :: * -> *). Monad m => StateT s m s) -> CmdLineP s s
forall s a.
(forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
CmdLineP forall (m :: * -> *). Monad m => StateT s m s
forall (m :: * -> *) s. Monad m => StateT s m s
State.get
putCmdLineState :: s -> CmdLineP s ()
putCmdLineState :: s -> CmdLineP s ()
putCmdLineState s
x = (forall (m :: * -> *). Monad m => StateT s m ()) -> CmdLineP s ()
forall s a.
(forall (m :: * -> *). Monad m => StateT s m a) -> CmdLineP s a
CmdLineP (s -> StateT s m ()
forall (m :: * -> *) s. Monad m => s -> StateT s m ()
State.put s
x)
runCmdLineP :: CmdLineP s a -> s -> (a, s)
runCmdLineP :: CmdLineP s a -> s -> (a, s)
runCmdLineP (CmdLineP forall (m :: * -> *). Monad m => StateT s m a
k) s
s0 = Identity (a, s) -> (a, s)
forall a. Identity a -> a
runIdentity (Identity (a, s) -> (a, s)) -> Identity (a, s) -> (a, s)
forall a b. (a -> b) -> a -> b
$ StateT s Identity a -> s -> Identity (a, s)
forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT StateT s Identity a
forall (m :: * -> *). Monad m => StateT s m a
k s
s0
processCmdLineP
:: forall s m. MonadIO m
=> [Flag (CmdLineP s)]
-> s
-> [Located String]
-> m (([Located String], [Err], [Warn]), s)
processCmdLineP :: [Flag (CmdLineP s)]
-> s
-> [Located String]
-> m (([Located String], [Err], [Warn]), s)
processCmdLineP [Flag (CmdLineP s)]
activeFlags s
s0 [Located String]
args =
StateT s m ([Located String], [Err], [Warn])
-> s -> m (([Located String], [Err], [Warn]), s)
forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT ([Flag (StateT s m)]
-> [Located String]
-> (String -> EwM (StateT s m) [Located String])
-> StateT s m ([Located String], [Err], [Warn])
forall (m :: * -> *).
Monad m =>
[Flag m]
-> [Located String]
-> (String -> EwM m [Located String])
-> m ([Located String], [Err], [Warn])
processArgs ((Flag (CmdLineP s) -> Flag (StateT s m))
-> [Flag (CmdLineP s)] -> [Flag (StateT s m)]
forall a b. (a -> b) -> [a] -> [b]
map ((forall a. CmdLineP s a -> StateT s m a)
-> Flag (CmdLineP s) -> Flag (StateT s m)
forall (m :: * -> *) (n :: * -> *).
(forall a. m a -> n a) -> Flag m -> Flag n
hoistFlag forall a. CmdLineP s a -> StateT s m a
getCmdLineP) [Flag (CmdLineP s)]
activeFlags) [Located String]
args String -> EwM (StateT s m) [Located String]
forall (m :: * -> *). MonadIO m => String -> EwM m [Located String]
parseResponseFile) s
s0
where
getCmdLineP :: CmdLineP s a -> StateT s m a
getCmdLineP :: CmdLineP s a -> StateT s m a
getCmdLineP (CmdLineP forall (m :: * -> *). Monad m => StateT s m a
k) = StateT s m a
forall (m :: * -> *). Monad m => StateT s m a
k
parseDynamicFlagsFull
:: forall m. MonadIO m
=> [Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsFull :: [Flag (CmdLineP DynFlags)]
-> Bool
-> DynFlags
-> [Located String]
-> m (DynFlags, [Located String], [Warn])
parseDynamicFlagsFull [Flag (CmdLineP DynFlags)]
activeFlags Bool
cmdline DynFlags
dflags0 [Located String]
args = do
(([Located String]
leftover, [Err]
errs, [Warn]
warns), DynFlags
dflags1) <- [Flag (CmdLineP DynFlags)]
-> DynFlags
-> [Located String]
-> m (([Located String], [Err], [Warn]), DynFlags)
forall s (m :: * -> *).
MonadIO m =>
[Flag (CmdLineP s)]
-> s
-> [Located String]
-> m (([Located String], [Err], [Warn]), s)
processCmdLineP [Flag (CmdLineP DynFlags)]
activeFlags DynFlags
dflags0 [Located String]
args
let rdr :: SDoc -> String
rdr = SDocContext -> SDoc -> String
renderWithContext (DynFlags -> PprStyle -> SDocContext
initSDocContext DynFlags
dflags0 PprStyle
defaultUserStyle)
Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ([Err] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [Err]
errs) (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ GhcException -> IO ()
forall a. GhcException -> IO a
throwGhcExceptionIO (GhcException -> IO ()) -> GhcException -> IO ()
forall a b. (a -> b) -> a -> b
$ [(String, String)] -> GhcException
errorsToGhcException ([(String, String)] -> GhcException)
-> [(String, String)] -> GhcException
forall a b. (a -> b) -> a -> b
$
(Err -> (String, String)) -> [Err] -> [(String, String)]
forall a b. (a -> b) -> [a] -> [b]
map ((SDoc -> String
rdr (SDoc -> String)
-> (Located String -> SDoc) -> Located String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcSpan -> SDoc
forall a. Outputable a => a -> SDoc
ppr (SrcSpan -> SDoc)
-> (Located String -> SrcSpan) -> Located String -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Located String -> SrcSpan
forall l e. GenLocated l e -> l
getLoc (Located String -> String)
-> (Located String -> String) -> Located String -> (String, String)
forall (a :: * -> * -> *) b c c'.
Arrow a =>
a b c -> a b c' -> a b (c, c')
&&& Located String -> String
forall l e. GenLocated l e -> e
unLoc) (Located String -> (String, String))
-> (Err -> Located String) -> Err -> (String, String)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Err -> Located String
errMsg) ([Err] -> [(String, String)]) -> [Err] -> [(String, String)]
forall a b. (a -> b) -> a -> b
$ [Err]
errs
let (DynFlags
dflags2, [Located String]
sh_warns) = Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck Bool
cmdline DynFlags
dflags1
theWays :: Ways
theWays = DynFlags -> Ways
ways DynFlags
dflags2
Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Ways -> Bool
allowed_combination Ways
theWays) (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$
GhcException -> IO ()
forall a. GhcException -> IO a
throwGhcExceptionIO (String -> GhcException
CmdLineError (String
"combination not supported: " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate String
"/" ((Way -> String) -> [Way] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Way -> String
wayDesc (Ways -> [Way]
forall a. Set a -> [a]
Set.toAscList Ways
theWays))))
let (DynFlags
dflags3, [Located String]
consistency_warnings) = DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent DynFlags
dflags2
Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (DynFlags -> Bool
enableTimeStats DynFlags
dflags3) (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO ()
enableTimingStats
case (DynFlags -> Maybe Int
ghcHeapSize DynFlags
dflags3) of
Just Int
x -> IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (Int -> IO ()
setHeapSize Int
x)
Maybe Int
_ -> () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DynFlags -> IO ()
setUnsafeGlobalDynFlags DynFlags
dflags3
let warns' :: [Warn]
warns' = (Located String -> Warn) -> [Located String] -> [Warn]
forall a b. (a -> b) -> [a] -> [b]
map (DiagnosticReason -> Located String -> Warn
Warn DiagnosticReason
WarningWithoutFlag) ([Located String]
consistency_warnings [Located String] -> [Located String] -> [Located String]
forall a. [a] -> [a] -> [a]
++ [Located String]
sh_warns)
(DynFlags, [Located String], [Warn])
-> m (DynFlags, [Located String], [Warn])
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags
dflags3, [Located String]
leftover, [Warn]
warns' [Warn] -> [Warn] -> [Warn]
forall a. [a] -> [a] -> [a]
++ [Warn]
warns)
safeFlagCheck :: Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck :: Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck Bool
_ DynFlags
dflags | DynFlags -> Bool
safeLanguageOn DynFlags
dflags = (DynFlags
dflagsUnset, [Located String]
warns)
where
(DynFlags
dflagsUnset, [Located String]
warns) = ((DynFlags, [Located String])
-> (String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)
-> (DynFlags, [Located String]))
-> (DynFlags, [Located String])
-> [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
-> (DynFlags, [Located String])
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl' (DynFlags, [Located String])
-> (String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)
-> (DynFlags, [Located String])
forall a l.
(a, [GenLocated l String])
-> (String, a -> l, a -> Bool, a -> a)
-> (a, [GenLocated l String])
check_method (DynFlags
dflags, []) [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlags
check_method :: (a, [GenLocated l String])
-> (String, a -> l, a -> Bool, a -> a)
-> (a, [GenLocated l String])
check_method (a
df, [GenLocated l String]
warns) (String
str,a -> l
loc,a -> Bool
test,a -> a
fix)
| a -> Bool
test a
df = (a -> a
fix a
df, [GenLocated l String]
warns [GenLocated l String]
-> [GenLocated l String] -> [GenLocated l String]
forall a. [a] -> [a] -> [a]
++ l -> String -> [GenLocated l String]
forall l. l -> String -> [GenLocated l String]
safeFailure (a -> l
loc a
df) String
str)
| Bool
otherwise = (a
df, [GenLocated l String]
warns)
safeFailure :: l -> String -> [GenLocated l String]
safeFailure l
loc String
str
= [l -> String -> GenLocated l String
forall l e. l -> e -> GenLocated l e
L l
loc (String -> GenLocated l String) -> String -> GenLocated l String
forall a b. (a -> b) -> a -> b
$ String
str String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" is not allowed in Safe Haskell; ignoring "
String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str]
safeFlagCheck Bool
cmdl DynFlags
dflags =
case DynFlags -> Bool
safeInferOn DynFlags
dflags of
Bool
True -> (DynFlags
dflags' { safeInferred :: Bool
safeInferred = Bool
safeFlags }, [Located String]
warn)
Bool
False -> (DynFlags
dflags', [Located String]
warn)
where
(DynFlags
dflags', [Located String]
warn)
| Bool -> Bool
not (DynFlags -> Bool
safeHaskellModeEnabled DynFlags
dflags) Bool -> Bool -> Bool
&& Bool -> Bool
not Bool
cmdl Bool -> Bool -> Bool
&& DynFlags -> Bool
packageTrustOn DynFlags
dflags
= (DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_PackageTrust, [Located String]
pkgWarnMsg)
| Bool
otherwise = (DynFlags
dflags, [])
pkgWarnMsg :: [Located String]
pkgWarnMsg = [SrcSpan -> String -> Located String
forall l e. l -> e -> GenLocated l e
L (DynFlags -> SrcSpan
pkgTrustOnLoc DynFlags
dflags') (String -> Located String) -> String -> Located String
forall a b. (a -> b) -> a -> b
$
String
"-fpackage-trust ignored;" String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
" must be specified with a Safe Haskell flag"]
safeFlags :: Bool
safeFlags = ((String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)
-> Bool)
-> [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
-> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (\(String
_,DynFlags -> SrcSpan
_,DynFlags -> Bool
t,DynFlags -> DynFlags
_) -> Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ DynFlags -> Bool
t DynFlags
dflags) [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlagsForInfer
allNonDeprecatedFlags :: [String]
allNonDeprecatedFlags :: [String]
allNonDeprecatedFlags = Bool -> [String]
allFlagsDeps Bool
False
allFlagsDeps :: Bool -> [String]
allFlagsDeps :: Bool -> [String]
allFlagsDeps Bool
keepDeprecated = [ Char
'-'Char -> ShowS
forall a. a -> [a] -> [a]
:Flag (CmdLineP DynFlags) -> String
forall (m :: * -> *). Flag m -> String
flagName Flag (CmdLineP DynFlags)
flag
| (Deprecation
deprecated, Flag (CmdLineP DynFlags)
flag) <- [(Deprecation, Flag (CmdLineP DynFlags))]
flagsAllDeps
, Bool
keepDeprecated Bool -> Bool -> Bool
|| Bool -> Bool
not (Deprecation -> Bool
isDeprecated Deprecation
deprecated)]
where isDeprecated :: Deprecation -> Bool
isDeprecated Deprecation
Deprecated = Bool
True
isDeprecated Deprecation
_ = Bool
False
flagsAll :: [Flag (CmdLineP DynFlags)]
flagsAll :: [Flag (CmdLineP DynFlags)]
flagsAll = ((Deprecation, Flag (CmdLineP DynFlags))
-> Flag (CmdLineP DynFlags))
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [Flag (CmdLineP DynFlags)]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, Flag (CmdLineP DynFlags)) -> Flag (CmdLineP DynFlags)
forall a b. (a, b) -> b
snd [(Deprecation, Flag (CmdLineP DynFlags))]
flagsAllDeps
flagsAllDeps :: [(Deprecation, Flag (CmdLineP DynFlags))]
flagsAllDeps :: [(Deprecation, Flag (CmdLineP DynFlags))]
flagsAllDeps = [(Deprecation, Flag (CmdLineP DynFlags))]
package_flags_deps [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ [(Deprecation, Flag (CmdLineP DynFlags))]
dynamic_flags_deps
flagsDynamic :: [Flag (CmdLineP DynFlags)]
flagsDynamic :: [Flag (CmdLineP DynFlags)]
flagsDynamic = ((Deprecation, Flag (CmdLineP DynFlags))
-> Flag (CmdLineP DynFlags))
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [Flag (CmdLineP DynFlags)]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, Flag (CmdLineP DynFlags)) -> Flag (CmdLineP DynFlags)
forall a b. (a, b) -> b
snd [(Deprecation, Flag (CmdLineP DynFlags))]
dynamic_flags_deps
flagsPackage :: [Flag (CmdLineP DynFlags)]
flagsPackage :: [Flag (CmdLineP DynFlags)]
flagsPackage = ((Deprecation, Flag (CmdLineP DynFlags))
-> Flag (CmdLineP DynFlags))
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [Flag (CmdLineP DynFlags)]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, Flag (CmdLineP DynFlags)) -> Flag (CmdLineP DynFlags)
forall a b. (a, b) -> b
snd [(Deprecation, Flag (CmdLineP DynFlags))]
package_flags_deps
type FlagMaker m = String -> OptKind m -> Flag m
type DynFlagMaker = FlagMaker (CmdLineP DynFlags)
data Deprecation = NotDeprecated | Deprecated deriving (Deprecation -> Deprecation -> Bool
(Deprecation -> Deprecation -> Bool)
-> (Deprecation -> Deprecation -> Bool) -> Eq Deprecation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Deprecation -> Deprecation -> Bool
$c/= :: Deprecation -> Deprecation -> Bool
== :: Deprecation -> Deprecation -> Bool
$c== :: Deprecation -> Deprecation -> Bool
Eq, Eq Deprecation
Eq Deprecation
-> (Deprecation -> Deprecation -> Ordering)
-> (Deprecation -> Deprecation -> Bool)
-> (Deprecation -> Deprecation -> Bool)
-> (Deprecation -> Deprecation -> Bool)
-> (Deprecation -> Deprecation -> Bool)
-> (Deprecation -> Deprecation -> Deprecation)
-> (Deprecation -> Deprecation -> Deprecation)
-> Ord Deprecation
Deprecation -> Deprecation -> Bool
Deprecation -> Deprecation -> Ordering
Deprecation -> Deprecation -> Deprecation
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Deprecation -> Deprecation -> Deprecation
$cmin :: Deprecation -> Deprecation -> Deprecation
max :: Deprecation -> Deprecation -> Deprecation
$cmax :: Deprecation -> Deprecation -> Deprecation
>= :: Deprecation -> Deprecation -> Bool
$c>= :: Deprecation -> Deprecation -> Bool
> :: Deprecation -> Deprecation -> Bool
$c> :: Deprecation -> Deprecation -> Bool
<= :: Deprecation -> Deprecation -> Bool
$c<= :: Deprecation -> Deprecation -> Bool
< :: Deprecation -> Deprecation -> Bool
$c< :: Deprecation -> Deprecation -> Bool
compare :: Deprecation -> Deprecation -> Ordering
$ccompare :: Deprecation -> Deprecation -> Ordering
$cp1Ord :: Eq Deprecation
Ord)
make_ord_flag :: DynFlagMaker -> String -> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag :: DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
fm String
name OptKind (CmdLineP DynFlags)
kind = (Deprecation
NotDeprecated, DynFlagMaker
fm String
name OptKind (CmdLineP DynFlags)
kind)
make_dep_flag :: DynFlagMaker -> String -> OptKind (CmdLineP DynFlags) -> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag :: DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
fm String
name OptKind (CmdLineP DynFlags)
kind String
message = (Deprecation
Deprecated,
DynFlagMaker
fm String
name (OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags))
-> OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ OptKind (CmdLineP DynFlags)
-> String -> OptKind (CmdLineP DynFlags)
add_dep_message OptKind (CmdLineP DynFlags)
kind String
message)
add_dep_message :: OptKind (CmdLineP DynFlags) -> String
-> OptKind (CmdLineP DynFlags)
add_dep_message :: OptKind (CmdLineP DynFlags)
-> String -> OptKind (CmdLineP DynFlags)
add_dep_message (NoArg DynP ()
f) String
message = DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ DynP ()
f DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (HasArg String -> DynP ()
f) String
message = (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (SepArg String -> DynP ()
f) String
message = (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
SepArg ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (Prefix String -> DynP ()
f) String
message = (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
Prefix ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (OptPrefix String -> DynP ()
f) String
message =
(String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
OptPrefix ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (OptIntSuffix Maybe Int -> DynP ()
f) String
message =
(Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix ((Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \Maybe Int
oi -> Maybe Int -> DynP ()
f Maybe Int
oi DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (IntSuffix Int -> DynP ()
f) String
message =
(Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Int -> EwM m ()) -> OptKind m
IntSuffix ((Int -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \Int
i -> Int -> DynP ()
f Int
i DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (WordSuffix Word -> DynP ()
f) String
message =
(Word -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Word -> EwM m ()) -> OptKind m
WordSuffix ((Word -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (Word -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \Word
i -> Word -> DynP ()
f Word
i DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (FloatSuffix Float -> DynP ()
f) String
message =
(Float -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Float -> EwM m ()) -> OptKind m
FloatSuffix ((Float -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (Float -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \Float
fl -> Float -> DynP ()
f Float
fl DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (PassFlag String -> DynP ()
f) String
message =
(String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
PassFlag ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
add_dep_message (AnySuffix String -> DynP ()
f) String
message =
(String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
AnySuffix ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
s -> String -> DynP ()
f String
s DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
message
dynamic_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]
dynamic_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]
dynamic_flags_deps = [
DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"n" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ())
String
"The -n flag is deprecated and no longer has any effect"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"cpp" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Extension -> DynP ()
setExtensionFlag Extension
LangExt.Cpp))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"F" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Pp))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"#include"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\String
_s ->
String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String
"-#include and INCLUDE pragmas are " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"deprecated: They no longer have any effect"))))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"v" ((Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix Maybe Int -> DynP ()
setVerbosity)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"j" ((Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix
(\Maybe Int
n -> case Maybe Int
n of
Just Int
n
| Int
n Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
0 -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { parMakeCount :: Maybe Int
parMakeCount = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n })
| Bool
otherwise -> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addErr String
"Syntax: -j[n] where n > 0"
Maybe Int
Nothing -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { parMakeCount :: Maybe Int
parMakeCount = Maybe Int
forall a. Maybe a
Nothing })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"instantiated-with" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg String -> DynFlags -> DynFlags
setUnitInstantiations)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"this-component-id" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg String -> DynFlags -> DynFlags
setUnitInstanceOf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"H" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\String
s -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d ->
DynFlags
d { ghcHeapSize :: Maybe Int
ghcHeapSize = Int -> Maybe Int
forall a. a -> Maybe a
Just (Int -> Maybe Int) -> Int -> Maybe Int
forall a b. (a -> b) -> a -> b
$ Integer -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (String -> Integer
decodeSize String
s)})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Rghc-timing" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d ->
DynFlags
d { enableTimeStats :: Bool
enableTimeStats = Bool
True })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"prof" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWayDynP Way
WayProf))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"eventlog"
(OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags))
-> OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM ((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> do
String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
"the eventlog is now enabled in all runtime system ways"
DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
d)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"debug" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWayDynP Way
WayDebug))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"threaded" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWayDynP Way
WayThreaded))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Way -> DynP ()
addWayDynP Way
WayDebug))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"static" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeWayDyn)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynamic" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWayDynP Way
WayDyn))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rdynamic" (OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$
#if defined(linux_HOST_OS)
String -> DynFlags -> DynFlags
addOptl String
"-rdynamic"
#elif defined(mingw32_HOST_OS)
addOptl "-Wl,--export-all-symbols"
#else
id
#endif
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"relative-dynlib-paths"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_RelativeDynlibPaths))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"copy-libs-when-linking"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SingleLibFolder))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"pie" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PICExecutable))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-pie" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_PICExecutable))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fcompact-unwind"
((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM (\DynFlags
dflags -> do
if Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags) OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSDarwin
then DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dflags GeneralFlag
Opt_CompactUnwind)
else do String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addWarn String
"-compact-unwind is only implemented by the darwin platform. Ignoring."
DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmlo"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_lo :: (String, [Option])
toolSettings_pgm_lo = (String
f,[]) }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmlc"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_lc :: (String, [Option])
toolSettings_pgm_lc = (String
f,[]) }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmlm"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_lm :: Maybe (String, [Option])
toolSettings_pgm_lm =
if String -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null String
f then Maybe (String, [Option])
forall a. Maybe a
Nothing else (String, [Option]) -> Maybe (String, [Option])
forall a. a -> Maybe a
Just (String
f,[]) }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmi"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_i :: String
toolSettings_pgm_i = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmL"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_L :: String
toolSettings_pgm_L = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmP"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setPgmP)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmF"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_F :: String
toolSettings_pgm_F = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmc"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_c :: String
toolSettings_pgm_c = String
f }
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmc-supports-no-pie"
(OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags))
-> OptKind (CmdLineP DynFlags) -> Flag (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM ((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> do
String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"use -pgml-supports-no-pie instead"
DynFlags -> DynP DynFlags
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings (\ToolSettings
s -> ToolSettings
s { toolSettings_ccSupportsNoPie :: Bool
toolSettings_ccSupportsNoPie = Bool
True }) DynFlags
d)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgms"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\String
_ -> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addWarn String
"Object splitting was removed in GHC 8.8"))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgma"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_a :: (String, [Option])
toolSettings_pgm_a = (String
f,[]) }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgml"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s
{ toolSettings_pgm_l :: (String, [Option])
toolSettings_pgm_l = (String
f,[])
,
toolSettings_ccSupportsNoPie :: Bool
toolSettings_ccSupportsNoPie = Bool
False
}
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgml-supports-no-pie"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_ccSupportsNoPie :: Bool
toolSettings_ccSupportsNoPie = Bool
True }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmdll"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_dll :: (String, [Option])
toolSettings_pgm_dll = (String
f,[]) }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmwindres"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_windres :: String
toolSettings_pgm_windres = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmar"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_ar :: String
toolSettings_pgm_ar = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmotool"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_otool :: String
toolSettings_pgm_otool = String
f}
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgminstall_name_tool"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_install_name_tool :: String
toolSettings_pgm_install_name_tool = String
f}
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"pgmranlib"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_pgm_ranlib :: String
toolSettings_pgm_ranlib = String
f }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optlm"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_lm :: [String]
toolSettings_opt_lm = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_lm ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optlo"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_lo :: [String]
toolSettings_opt_lo = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_lo ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optlc"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_lc :: [String]
toolSettings_opt_lc = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_lc ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"opti"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_i :: [String]
toolSettings_opt_i = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_i ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optL"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_L :: [String]
toolSettings_opt_L = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_L ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optP"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addOptP)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optF"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_F :: [String]
toolSettings_opt_F = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_F ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optc"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addOptc)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optcxx"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addOptcxx)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"opta"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f -> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_a :: [String]
toolSettings_opt_a = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_a ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optl"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addOptl)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"optwindres"
(OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags))
-> (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
f ->
(ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ((ToolSettings -> ToolSettings) -> DynFlags -> DynFlags)
-> (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ \ToolSettings
s -> ToolSettings
s { toolSettings_opt_windres :: [String]
toolSettings_opt_windres = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: ToolSettings -> [String]
toolSettings_opt_windres ToolSettings
s }
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"split-objs"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addWarn String
"ignoring -split-objs")
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"split-sections"
((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM (\DynFlags
dflags -> do
if Platform -> Bool
platformHasSubsectionsViaSymbols (DynFlags -> Platform
targetPlatform DynFlags
dflags)
then do String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addWarn (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$
String
"-split-sections is not useful on this platform " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"since it always uses subsections via symbols. Ignoring."
DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags
else DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dflags GeneralFlag
Opt_SplitSections)))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dep-suffix" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addDepSuffix)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dep-makefile" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setDepMakefile)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"include-cpp-deps"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (Bool -> DynFlags -> DynFlags
setDepIncludeCppDeps Bool
True))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"include-pkg-deps"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps Bool
True))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"exclude-module" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addDepExcludeMod)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-link"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
NoLink }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"shared"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
LinkDynLib }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"staticlib"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
Opt_LinkRts (DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
LinkStaticLib })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"-merge-objs"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
LinkMergedObj }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynload" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
parseDynLibLoaderMode)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dylib-install-name" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setDylibInstallName)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"L" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
Prefix String -> DynP ()
addLibraryPath)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"l" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (Option -> DynFlags -> DynFlags
addLdInputs (Option -> DynFlags -> DynFlags)
-> (String -> Option) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Option
Option (String -> Option) -> ShowS -> String -> Option
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
"-l" String -> ShowS
forall a. [a] -> [a] -> [a]
++)))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"framework-path" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
addFrameworkPath)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"framework" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addCmdlineFramework)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"odir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setObjectDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"o" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (Maybe String -> DynFlags -> DynFlags
setOutputFile (Maybe String -> DynFlags -> DynFlags)
-> (String -> Maybe String) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe String
forall a. a -> Maybe a
Just))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dyno"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (Maybe String -> DynFlags -> DynFlags
setDynOutputFile (Maybe String -> DynFlags -> DynFlags)
-> (String -> Maybe String) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe String
forall a. a -> Maybe a
Just))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ohi"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (Maybe String -> DynFlags -> DynFlags
setOutputHi (Maybe String -> DynFlags -> DynFlags)
-> (String -> Maybe String) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe String
forall a. a -> Maybe a
Just ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynohi"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (Maybe String -> DynFlags -> DynFlags
setDynOutputHi (Maybe String -> DynFlags -> DynFlags)
-> (String -> Maybe String) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe String
forall a. a -> Maybe a
Just ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"osuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setObjectSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynosuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setDynObjectSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hcsuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setHcSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hisuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setHiSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hiesuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setHieSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynhisuf" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setDynHiSuf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hidir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setHiDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hiedir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setHieDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"tmpdir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setTmpDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"stubdir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setStubDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dumpdir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setDumpDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"outputdir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setOutputDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-file-prefix"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (Maybe String -> DynFlags -> DynFlags
setDumpPrefixForce (Maybe String -> DynFlags -> DynFlags)
-> (String -> Maybe String) -> String -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe String
forall a. a -> Maybe a
Just (String -> Maybe String) -> ShowS -> String -> Maybe String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> ShowS) -> String -> ShowS
forall a b c. (a -> b -> c) -> b -> a -> c
flip String -> ShowS
forall a. [a] -> [a] -> [a]
(++) String
"."))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dynamic-too"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_BuildDynamicToo))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hc-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHcFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hc-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHcFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hscpp-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHscppFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hscpp-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHscppFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-s-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepSFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-s-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepSFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-llvm-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ Backend -> DynP ()
setObjBackend Backend
LLVM DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepLlvmFiles)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-llvm-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ Backend -> DynP ()
setObjBackend Backend
LLVM DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepLlvmFiles)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-tmp-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepTmpFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hi-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHiFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-keep-hi-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_KeepHiFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-hi-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepHiFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-keep-hi-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_KeepHiFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-o-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepOFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-keep-o-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_KeepOFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"keep-o-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepOFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-keep-o-files"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_KeepOFiles))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-auto-link-packages"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_AutoLinkPackages))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-hs-main"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_NoHsMain))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fno-state-hack"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_G_NoStateHack))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fno-opt-coercion"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_G_NoOptCoercion))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"with-rtsopts"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
setRtsOpts)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsAll))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts=all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsAll))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts=some"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsSafeOnly))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts=none"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsNone))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts=ignore"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsIgnore))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"rtsopts=ignoreAll"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsIgnoreAll))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-rtsopts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
RtsOptsNone))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-rtsopts-suggestions"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d {rtsOptsSuggestions :: Bool
rtsOptsSuggestions = Bool
False}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dhex-word-literals"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_HexWordLiterals))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ghcversion-file" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addGhcVersionFile)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"main-is" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
SepArg String -> DynP ()
setMainIs)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"haddock" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Haddock))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-haddock" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_Haddock))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"haddock-opts" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addHaddockOpts)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hpcdir" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
SepArg String -> DynP ()
setOptHpcDir)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhciFlag String
"ghci-script" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addGhciScript)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhciFlag String
"interactive-print" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setInteractivePrint)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky-allocd"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky_Allocd))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky-LNE"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky_LNE))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky-ap-thunk"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky_AP))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky-dyn-thunk"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky_Dyn_Thunk))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ticky-tag-checks"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_Ticky_Tag))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"recomp"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_ForceRecomp)
String
"Use -fno-force-recomp instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-recomp"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_ForceRecomp) String
"Use -fforce-recomp instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-errors"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxErrors :: Maybe Int
maxErrors = Int -> Maybe Int
forall a. a -> Maybe a
Just (Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
1 Int
n) }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-max-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { maxErrors :: Maybe Int
maxErrors = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"freverse-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d {reverseErrors :: Bool
reverseErrors = Bool
True} ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-reverse-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d {reverseErrors :: Bool
reverseErrors = Bool
False} ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"D" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
AnySuffix ((DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (String -> DynFlags -> DynFlags) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
addOptP))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"U" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
AnySuffix ((DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (String -> DynFlags -> DynFlags) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
addOptP))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"I" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
Prefix String -> DynP ()
addIncludePath)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"i" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
OptPrefix String -> DynP ()
addImportPath)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"dppr-user-length" ((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d ->
DynFlags
d { pprUserLength :: Int
pprUserLength = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"dppr-cols" ((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d ->
DynFlags
d { pprCols :: Int
pprCols = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fdiagnostics-color=auto"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { useColor :: OverridingBool
useColor = OverridingBool
Auto })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fdiagnostics-color=always"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { useColor :: OverridingBool
useColor = OverridingBool
Always })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fdiagnostics-color=never"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { useColor :: OverridingBool
useColor = OverridingBool
Never })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dsuppress-all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ do GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressCoercions
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressVarKinds
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressModulePrefixes
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressTypeApplications
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressIdInfo
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressTicks
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressStgExts
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressTypeSignatures
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressCoreSizes
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SuppressTimestamps)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dstg-stats"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_StgStats))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-from-stg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_from_stg)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-raw"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_raw)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-verbose"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_verbose)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-verbose-by-proc"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_verbose_by_proc)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-cfg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_cfg)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-cbe"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_cbe)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-switch"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_switch)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-proc"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_proc)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-sp"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_sp)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-sink"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_sink)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-caf"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_caf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-procmap"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_procmap)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-split"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_split)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-info"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_info)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-cps"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cmm_cps)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cmm-opt"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_opt_cmm)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cfg-weights"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cfg_weights)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-core-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_core_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-native"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_native)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-liveness"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_liveness)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-regalloc"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_regalloc)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-conflicts"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_conflicts)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-regalloc-stages"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_regalloc_stages)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-asm-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-llvm"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ Backend -> DynP ()
setObjBackend Backend
LLVM DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_dump_llvm)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-c-backend"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_dump_c_backend)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-deriv"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_deriv)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-ds"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_ds)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-ds-preopt"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_ds_preopt)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-foreign"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_foreign)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-inlinings"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_inlinings)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-verbose-inlinings"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_verbose_inlinings)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rule-firings"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rule_firings)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rule-rewrites"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rule_rewrites)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-simpl-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_simpl_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-occur-anal"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_occur_anal)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-parsed"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_parsed)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-parsed-ast"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_parsed_ast)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dkeep-comments"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_KeepRawTokenStream))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rn"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rn)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rn-ast"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rn_ast)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-simpl"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_simpl)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-simpl-iterations"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_simpl_iterations)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-spec"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_spec)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-prep"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_prep)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg-from-core"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_from_core)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg-unarised"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_unarised)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg-final"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_final)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg-cg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_cg)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_from_core)
String
"Use `-ddump-stg-from-core` or `-ddump-stg-final` instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stg-tags"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg_tags)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-call-arity"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_call_arity)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-exitify"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_exitify)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-stranal"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stranal)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-str-signatures"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_str_signatures)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cpranal"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cpranal)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cpr-signatures"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cpr_signatures)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-tc"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_tc)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-tc-ast"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_tc_ast)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-hie"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_hie)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-types"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_types)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rules"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rules)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cse"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cse)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-worker-wrapper"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_worker_wrapper)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rn-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rn_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-if-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_if_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-cs-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_cs_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-tc-trace"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (do DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_dump_tc_trace
DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_dump_cs_trace))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-ec-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_ec_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-splices"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_splices)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dth-dec-file"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_th_dec_file)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rn-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rn_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-opt-cmm"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_opt_cmm)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-simpl-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_simpl_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-bcos"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_BCOs)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dsource-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_source_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dverbose-core2core"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ Maybe Int -> DynP ()
setVerbosity (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
2) DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_verbose_core2core)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dverbose-stg2stg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_verbose_stg2stg)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-hi"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_hi)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-minimal-imports"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_D_dump_minimal_imports))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-hpc"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_ticked)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-ticked"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_ticked)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-mod-cycles"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_mod_cycles)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-mod-map"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_mod_map)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-timings"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_timings)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-view-pattern-commoning"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_view_pattern_commoning)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-to-file"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DumpToFile))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-hi-diffs"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_hi_diffs)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-rtti"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_rtti)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dlint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
enableDLint)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dcore-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoCoreLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dlinear-core-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoLinearCoreLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dstg-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoStgLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dcmm-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoCmmLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dasm-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoAsmLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dannot-lint"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoAnnotationLinting))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dtag-inference-checks"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DoTagInferenceChecks))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dshow-passes"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ DynP ()
forceRecompile DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Maybe Int -> DynP ()
setVerbosity (Maybe Int -> DynP ()) -> Maybe Int -> DynP ()
forall a b. (a -> b) -> a -> b
$ Int -> Maybe Int
forall a. a -> Maybe a
Just Int
2))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dfaststring-stats"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_faststring_stats)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dno-llvm-mangler"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_NoLlvmMangler))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dno-typeable-binds"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_NoTypeableBinds))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-debug"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_debug)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-json"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_json )
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dppr-debug"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_ppr_debug)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddebug-output"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg ((DynFlags -> DumpFlag -> DynFlags)
-> DumpFlag -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> DumpFlag -> DynFlags
dopt_unset DumpFlag
Opt_D_no_debug_output))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dno-debug-output"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_no_debug_output)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ddump-faststrings"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_faststrings)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"msse" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { sseVersion :: Maybe SseVersion
sseVersion = SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE1 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"msse2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { sseVersion :: Maybe SseVersion
sseVersion = SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE2 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"msse3" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { sseVersion :: Maybe SseVersion
sseVersion = SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE3 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"msse4" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { sseVersion :: Maybe SseVersion
sseVersion = SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE4 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"msse4.2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { sseVersion :: Maybe SseVersion
sseVersion = SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE42 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mbmi" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { bmiVersion :: Maybe BmiVersion
bmiVersion = BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI1 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mbmi2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { bmiVersion :: Maybe BmiVersion
bmiVersion = BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI2 }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { avx :: Bool
avx = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { avx2 :: Bool
avx2 = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx512cd" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { avx512cd :: Bool
avx512cd = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx512er" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { avx512er :: Bool
avx512er = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx512f" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { avx512f :: Bool
avx512f = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"mavx512pf" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { avx512pf :: Bool
avx512pf = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"W" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
minusWOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Werror"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (do { GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_WarnIsError
; (WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
setFatalWarningFlag [WarningFlag]
minusWeverythingOpts }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wwarn"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (do { GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_WarnIsError
; (WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
unSetFatalWarningFlag [WarningFlag]
minusWeverythingOpts }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wnot" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d ->
DynFlags
d {warningFlags :: EnumSet WarningFlag
warningFlags = EnumSet WarningFlag
forall a. EnumSet a
EnumSet.empty})))
String
"Use -w or -Wno-everything instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"w" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d ->
DynFlags
d {warningFlags :: EnumSet WarningFlag
warningFlags = EnumSet WarningFlag
forall a. EnumSet a
EnumSet.empty})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Weverything" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
minusWeverythingOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-everything"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d {warningFlags :: EnumSet WarningFlag
warningFlags = EnumSet WarningFlag
forall a. EnumSet a
EnumSet.empty})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wall" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
minusWallOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-all" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
unSetWarningFlag [WarningFlag]
minusWallOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wextra" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
minusWOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-extra" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
unSetWarningFlag [WarningFlag]
minusWOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wdefault" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
standardWarnings))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-default" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
unSetWarningFlag [WarningFlag]
standardWarnings))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wcompat" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
minusWcompatOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-compat" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_
WarningFlag -> DynP ()
unSetWarningFlag [WarningFlag]
minusWcompatOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fplugin-opt" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addPluginModuleNameOption)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fplugin-trustworthy"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PluginTrustworthy))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fplugin" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addPluginModuleName)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fclear-plugins" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg DynFlags -> DynFlags
clearPluginModuleNames)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"ffrontend-opt" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
addFrontendPluginOption)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"Onot" ((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM ((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ Int -> DynFlags -> DynP DynFlags
setOptLevel Int
0 )
String
"Use -O0 instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"O" ((Maybe Int -> DynFlags -> DynP DynFlags)
-> OptKind (CmdLineP DynFlags)
optIntSuffixM (\Maybe Int
mb_n ->
Int -> DynFlags -> DynP DynFlags
setOptLevel (Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` Int
1)))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fbinary-blob-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { binBlobThreshold :: Maybe Word
binBlobThreshold = case Int -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n of
Word
0 -> Maybe Word
forall a. Maybe a
Nothing
Word
x -> Word -> Maybe Word
forall a. a -> Maybe a
Just Word
x}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-relevant-binds"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxRelevantBinds :: Maybe Int
maxRelevantBinds = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-max-relevant-binds"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { maxRelevantBinds :: Maybe Int
maxRelevantBinds = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-valid-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxValidHoleFits :: Maybe Int
maxValidHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-max-valid-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { maxValidHoleFits :: Maybe Int
maxValidHoleFits = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-refinement-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxRefHoleFits :: Maybe Int
maxRefHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-max-refinement-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { maxRefHoleFits :: Maybe Int
maxRefHoleFits = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"frefinement-level-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { refLevelHoleFits :: Maybe Int
refLevelHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-refinement-level-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { refLevelHoleFits :: Maybe Int
refLevelHoleFits = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fllvm-pass-vectors-in-regs"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg DynFlags -> DynFlags
forall a. a -> a
id)
String
"vectors registers are now passed in registers by default."
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-uncovered-patterns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxUncoveredPatterns :: Int
maxUncoveredPatterns = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-pmcheck-models"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxPmCheckModels :: Int
maxPmCheckModels = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fsimplifier-phases"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { simplPhases :: Int
simplPhases = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-simplifier-iterations"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxSimplIterations :: Int
maxSimplIterations = Int
n }))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-pmcheck-iterations"
((Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM (\Int
_ DynFlags
d ->
do { String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"use -fmax-pmcheck-models instead"
; DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
d })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fsimpl-tick-factor"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { simplTickFactor :: Int
simplTickFactor = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fdmd-unbox-width"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { dmdUnboxWidth :: Int
dmdUnboxWidth = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fspec-constr-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { specConstrThreshold :: Maybe Int
specConstrThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-spec-constr-threshold"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { specConstrThreshold :: Maybe Int
specConstrThreshold = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fspec-constr-count"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { specConstrCount :: Maybe Int
specConstrCount = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-spec-constr-count"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { specConstrCount :: Maybe Int
specConstrCount = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fspec-constr-recursive"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { specConstrRecursive :: Int
specConstrRecursive = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fliberate-case-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { liberateCaseThreshold :: Maybe Int
liberateCaseThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-liberate-case-threshold"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { liberateCaseThreshold :: Maybe Int
liberateCaseThreshold = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"drule-check"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (\String
s DynFlags
d -> DynFlags
d { ruleCheck :: Maybe String
ruleCheck = String -> Maybe String
forall a. a -> Maybe a
Just String
s }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"dinline-check"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (\String
s DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Maybe String -> UnfoldingOpts -> UnfoldingOpts
updateReportPrefix (String -> Maybe String
forall a. a -> Maybe a
Just String
s) (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"freduction-depth"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { reductionDepth :: IntWithInf
reductionDepth = Int -> IntWithInf
treatZeroAsInf Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fconstraint-solver-iterations"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { solverIterations :: IntWithInf
solverIterations = Int -> IntWithInf
treatZeroAsInf Int
n }))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fcontext-stack"
((Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM (\Int
n DynFlags
d ->
do { String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"use -freduction-depth=" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
n String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" instead"
; DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
d { reductionDepth :: IntWithInf
reductionDepth = Int -> IntWithInf
treatZeroAsInf Int
n } })))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"ftype-function-depth"
((Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM (\Int
n DynFlags
d ->
do { String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"use -freduction-depth=" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
n String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" instead"
; DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
d { reductionDepth :: IntWithInf
reductionDepth = Int -> IntWithInf
treatZeroAsInf Int
n } })))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstrictness-before"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { strictnessBefore :: [Int]
strictnessBefore = Int
n Int -> [Int] -> [Int]
forall a. a -> [a] -> [a]
: DynFlags -> [Int]
strictnessBefore DynFlags
d }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"ffloat-lam-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { floatLamArgs :: Maybe Int
floatLamArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"ffloat-all-lams"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { floatLamArgs :: Maybe Int
floatLamArgs = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstg-lift-lams-rec-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { liftLamsRecArgs :: Maybe Int
liftLamsRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstg-lift-lams-rec-args-any"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { liftLamsRecArgs :: Maybe Int
liftLamsRecArgs = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstg-lift-lams-non-rec-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { liftLamsNonRecArgs :: Maybe Int
liftLamsNonRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstg-lift-lams-non-rec-args-any"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { liftLamsNonRecArgs :: Maybe Int
liftLamsNonRecArgs = Maybe Int
forall a. Maybe a
Nothing }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fstg-lift-lams-known"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { liftLamsKnown :: Bool
liftLamsKnown = Bool
True }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-stg-lift-lams-known"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { liftLamsKnown :: Bool
liftLamsKnown = Bool
False }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fproc-alignment"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { cmmProcAlignment :: Maybe Int
cmmProcAlignment = Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fblock-layout-weights"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\String
s ->
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { cfgWeights :: Weights
cfgWeights =
String -> Weights -> Weights
parseWeights String
s (DynFlags -> Weights
cfgWeights DynFlags
d)})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fhistory-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { historySize :: Int
historySize = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-creation-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateCreationThreshold Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-use-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateUseThreshold Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-fun-discount"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateFunAppDiscount Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-dict-discount"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateDictDiscount Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-case-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateCaseThreshold Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-case-scaling"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { unfoldingOpts :: UnfoldingOpts
unfoldingOpts = Int -> UnfoldingOpts -> UnfoldingOpts
updateCaseScaling Int
n (DynFlags -> UnfoldingOpts
unfoldingOpts DynFlags
d)}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"funfolding-keeness-factor"
((Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix (\Float
_ DynFlags
d -> DynFlags
d))
String
"-funfolding-keeness-factor is no longer respected as of GHC 9.0"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fmax-worker-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d {maxWorkerArgs :: Int
maxWorkerArgs = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhciFlag String
"fghci-hist-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d {ghciHistSize :: Int
ghciHistSize = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fmax-inline-alloc-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxInlineAllocSize :: Int
maxInlineAllocSize = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fmax-inline-memcpy-insns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxInlineMemcpyInsns :: Int
maxInlineMemcpyInsns = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fmax-inline-memset-insns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { maxInlineMemsetInsns :: Int
maxInlineMemsetInsns = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dinitial-unique"
((Word -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
wordSuffix (\Word
n DynFlags
d -> DynFlags
d { initialUnique :: Word
initialUnique = Word
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"dunique-increment"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\Int
n DynFlags
d -> DynFlags
d { uniqueIncrement :: Int
uniqueIncrement = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"auto-all"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoAll } ))
String
"Use -fprof-auto instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-auto-all"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto } ))
String
"Use -fno-prof-auto instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoExports } ))
String
"Use -fprof-auto-exported instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto } ))
String
"Use -fno-prof-auto instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"caf-all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_AutoSccsOnIndividualCafs))
String
"Use -fprof-cafs instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"no-caf-all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_AutoSccsOnIndividualCafs))
String
"Use -fno-prof-cafs instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fprof-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoAll } ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fprof-auto-top"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoTop } ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fprof-auto-exported"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoExports } ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fprof-auto-calls"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoCalls } ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fno-prof-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto } ))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fprof-callers"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
setCallerCcFilters)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fdistinct-constructor-tables"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DistinctConstructorTables))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"finfo-table-map"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_InfoTableMap))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fasm" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Backend -> DynP ()
setObjBackend Backend
NCG))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fvia-c" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg
(String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"The -fvia-c flag does nothing; " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"it will be removed in a future GHC release"))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fvia-C" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg
(String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ String
"The -fvia-C flag does nothing; " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"it will be removed in a future GHC release"))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fllvm" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Backend -> DynP ()
setObjBackend Backend
LLVM))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-code" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (((DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d ->
DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
NoLink }) DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Backend -> DynP ()
setBackend Backend
NoBackend))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fbyte-code"
((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM ((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags))
-> (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \DynFlags
dflags -> do
Backend -> DynP ()
setBackend Backend
Interpreter
DynFlags -> DynP DynFlags
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dflags GeneralFlag
Opt_ByteCode)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fobject-code" (OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall a b. (a -> b) -> a -> b
$ DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DynP () -> OptKind (CmdLineP DynFlags))
-> DynP () -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ do
DynFlags
dflags <- CmdLineP DynFlags DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM CmdLineP DynFlags DynFlags
forall s. CmdLineP s s
getCmdLineState
Backend -> DynP ()
setBackend (Backend -> DynP ()) -> Backend -> DynP ()
forall a b. (a -> b) -> a -> b
$ Platform -> Backend
platformDefaultBackend (DynFlags -> Platform
targetPlatform DynFlags
dflags)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fglasgow-exts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
enableGlasgowExts) String
"Use individual extensions instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-glasgow-exts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
disableGlasgowExts) String
"Use individual extensions instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wunused-binds" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
enableUnusedBinds)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-unused-binds" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
disableUnusedBinds)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defHiddenFlag String
"fwarn-unused-binds" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
enableUnusedBinds)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defHiddenFlag String
"fno-warn-unused-binds" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg
DynP ()
disableUnusedBinds)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fpackage-trust" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
setPackageTrust)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-safe-infer" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\DynFlags
d ->
DynFlags
d { safeInfer :: Bool
safeInfer = Bool
False }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"fno-safe-haskell" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (SafeHaskellMode -> DynP ()
setSafeHaskell SafeHaskellMode
Sf_Ignore))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fPIC" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PIC))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fno-PIC" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_PIC))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fPIE" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PIE))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"fno-PIE" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_PIE))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"g" ((Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix Maybe Int -> DynP ()
setDebugLevel)
]
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"" GeneralFlag -> DynP ()
setGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"no-" GeneralFlag -> DynP ()
unSetGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"d" GeneralFlag -> DynP ()
setGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
dFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"dno-" GeneralFlag -> DynP ()
unSetGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
dFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"f" GeneralFlag -> DynP ()
setGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
fFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (GeneralFlag -> DynP ())
-> (Deprecation, FlagSpec GeneralFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"fno-" GeneralFlag -> DynP ()
unSetGeneralFlag ) [(Deprecation, FlagSpec GeneralFlag)]
fFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"W" WarningFlag -> DynP ()
setWarningFlag ) [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"Wno-" WarningFlag -> DynP ()
unSetWarningFlag ) [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"Werror=" WarningFlag -> DynP ()
setWErrorFlag ) [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"Wwarn=" WarningFlag -> DynP ()
unSetFatalWarningFlag )
[(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"Wno-error=" WarningFlag -> DynP ()
unSetFatalWarningFlag )
[(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"fwarn-" WarningFlag -> DynP ()
setWarningFlag ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag))
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag)
forall a. (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag)
[(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (WarningFlag -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"fno-warn-" WarningFlag -> DynP ()
unSetWarningFlag ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> ((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag))
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag)
forall a. (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag)
[(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ [ (Deprecation
NotDeprecated, String -> Flag (CmdLineP DynFlags)
unrecognisedWarning String
"W"),
(Deprecation
Deprecated, String -> Flag (CmdLineP DynFlags)
unrecognisedWarning String
"fwarn-"),
(Deprecation
Deprecated, String -> Flag (CmdLineP DynFlags)
unrecognisedWarning String
"fno-warn-") ]
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ [ DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Werror=compat"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
setWErrorFlag [WarningFlag]
minusWcompatOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wno-error=compat"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
unSetFatalWarningFlag [WarningFlag]
minusWcompatOpts))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"Wwarn=compat"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
unSetFatalWarningFlag [WarningFlag]
minusWcompatOpts)) ]
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec Extension)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (Extension -> DynP ())
-> (Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"f" Extension -> DynP ()
setExtensionFlag ) [(Deprecation, FlagSpec Extension)]
fLangFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec Extension)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (Extension -> DynP ())
-> (Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"fno-" Extension -> DynP ()
unSetExtensionFlag) [(Deprecation, FlagSpec Extension)]
fLangFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec Extension)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (Extension -> DynP ())
-> (Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"X" Extension -> DynP ()
setExtensionFlag ) [(Deprecation, FlagSpec Extension)]
xFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec Extension)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (Extension -> DynP ())
-> (Deprecation, FlagSpec Extension)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOff String
"XNo" Extension -> DynP ()
unSetExtensionFlag) [(Deprecation, FlagSpec Extension)]
xFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec Language)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec Language)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (Language -> DynP ())
-> (Deprecation, FlagSpec Language)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"X" Language -> DynP ()
setLanguage ) [(Deprecation, FlagSpec Language)]
languageFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ ((Deprecation, FlagSpec SafeHaskellMode)
-> (Deprecation, Flag (CmdLineP DynFlags)))
-> [(Deprecation, FlagSpec SafeHaskellMode)]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a b. (a -> b) -> [a] -> [b]
map (Bool
-> String
-> (SafeHaskellMode -> DynP ())
-> (Deprecation, FlagSpec SafeHaskellMode)
-> (Deprecation, Flag (CmdLineP DynFlags))
forall flag.
Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turnOn String
"X" SafeHaskellMode -> DynP ()
setSafeHaskell ) [(Deprecation, FlagSpec SafeHaskellMode)]
safeHaskellFlagsDeps
unrecognisedWarning :: String -> Flag (CmdLineP DynFlags)
unrecognisedWarning :: String -> Flag (CmdLineP DynFlags)
unrecognisedWarning String
prefix = DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defHiddenFlag String
prefix ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
Prefix String -> DynP ()
action)
where
action :: String -> EwM (CmdLineP DynFlags) ()
action :: String -> DynP ()
action String
flag = do
Bool
f <- WarningFlag -> DynFlags -> Bool
wopt WarningFlag
Opt_WarnUnrecognisedWarningFlags (DynFlags -> Bool) -> DynP DynFlags -> EwM (CmdLineP DynFlags) Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CmdLineP DynFlags DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM CmdLineP DynFlags DynFlags
forall s. CmdLineP s s
getCmdLineState
Bool -> DynP () -> DynP ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
f (DynP () -> DynP ()) -> DynP () -> DynP ()
forall a b. (a -> b) -> a -> b
$ DiagnosticReason -> String -> DynP ()
forall (m :: * -> *).
Monad m =>
DiagnosticReason -> String -> EwM m ()
addFlagWarn (WarningFlag -> DiagnosticReason
WarningWithFlag WarningFlag
Opt_WarnUnrecognisedWarningFlags) (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$
String
"unrecognised warning flag: -" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
prefix String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag
package_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]
package_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]
package_flags_deps = [
DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"package-db"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (PkgDbRef -> DynP ()
addPkgDbRef (PkgDbRef -> DynP ()) -> (String -> PkgDbRef) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PkgDbRef
PkgDbPath))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"clear-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
clearPkgDb)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"no-global-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeGlobalPkgDb)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"no-user-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeUserPkgDb)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"global-package-db"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (PkgDbRef -> DynP ()
addPkgDbRef PkgDbRef
GlobalPkgDb))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"user-package-db"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (PkgDbRef -> DynP ()
addPkgDbRef PkgDbRef
UserPkgDb))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"package-conf"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ PkgDbRef -> DynP ()
addPkgDbRef (PkgDbRef -> DynP ()) -> (String -> PkgDbRef) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PkgDbRef
PkgDbPath) String
"Use -package-db instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"no-user-package-conf"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeUserPkgDb) String
"Use -no-user-package-db instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"package-name" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg ((String -> DynP ()) -> OptKind (CmdLineP DynFlags))
-> (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall a b. (a -> b) -> a -> b
$ \String
name ->
(DynFlags -> DynFlags) -> DynP ()
upd (String -> DynFlags -> DynFlags
setUnitId String
name))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"this-unit-id" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setUnitId)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"working-dir" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setWorkingDirectory)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"this-package-name" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
setPackageName)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"hidden-module" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
addHiddenModule)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag String
"reexported-module" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
addReexportedModule)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"package" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePackage)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"plugin-package-id" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePluginPackageId)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"plugin-package" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePluginPackage)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"package-id" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePackageId)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"hide-package" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
hidePackage)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"hide-all-packages"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_HideAllPackages))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"hide-all-plugin-packages"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_HideAllPluginPackages))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"package-env" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
setPackageEnv)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"ignore-package" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
ignorePackage)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"syslib" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePackage) String
"Use -package instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"distrust-all-packages"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_DistrustAllPackages))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"trust" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
trustPackage)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag String
"distrust" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
distrustPackage)
]
where
setPackageEnv :: String -> DynP ()
setPackageEnv String
env = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
s -> DynFlags
s { packageEnv :: Maybe String
packageEnv = String -> Maybe String
forall a. a -> Maybe a
Just String
env }
flagsForCompletion :: Bool -> [String]
flagsForCompletion :: Bool -> [String]
flagsForCompletion Bool
isInteractive
= [ Char
'-'Char -> ShowS
forall a. a -> [a] -> [a]
:Flag (CmdLineP DynFlags) -> String
forall (m :: * -> *). Flag m -> String
flagName Flag (CmdLineP DynFlags)
flag
| Flag (CmdLineP DynFlags)
flag <- [Flag (CmdLineP DynFlags)]
flagsAll
, GhcFlagMode -> Bool
modeFilter (Flag (CmdLineP DynFlags) -> GhcFlagMode
forall (m :: * -> *). Flag m -> GhcFlagMode
flagGhcMode Flag (CmdLineP DynFlags)
flag)
]
where
modeFilter :: GhcFlagMode -> Bool
modeFilter GhcFlagMode
AllModes = Bool
True
modeFilter GhcFlagMode
OnlyGhci = Bool
isInteractive
modeFilter GhcFlagMode
OnlyGhc = Bool -> Bool
not Bool
isInteractive
modeFilter GhcFlagMode
HiddenFlag = Bool
False
type TurnOnFlag = Bool
turnOn :: TurnOnFlag; turnOn :: Bool
turnOn = Bool
True
turnOff :: TurnOnFlag; turnOff :: Bool
turnOff = Bool
False
data FlagSpec flag
= FlagSpec
{ FlagSpec flag -> String
flagSpecName :: String
, FlagSpec flag -> flag
flagSpecFlag :: flag
, FlagSpec flag -> Bool -> DynP ()
flagSpecAction :: (TurnOnFlag -> DynP ())
, FlagSpec flag -> GhcFlagMode
flagSpecGhcMode :: GhcFlagMode
}
flagSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
name flag
flag = String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
name flag
flag Bool -> DynP ()
nop
flagSpec' :: String -> flag -> (TurnOnFlag -> DynP ())
-> (Deprecation, FlagSpec flag)
flagSpec' :: String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
name flag
flag Bool -> DynP ()
act = (Deprecation
NotDeprecated, String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name flag
flag Bool -> DynP ()
act GhcFlagMode
AllModes)
warnSpec :: WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec :: WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
flag = WarningFlag
-> (Bool -> DynP ()) -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec' WarningFlag
flag Bool -> DynP ()
nop
warnSpec' :: WarningFlag -> (TurnOnFlag -> DynP ())
-> [(Deprecation, FlagSpec WarningFlag)]
warnSpec' :: WarningFlag
-> (Bool -> DynP ()) -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec' WarningFlag
flag Bool -> DynP ()
act = [ (Deprecation
NotDeprecated, String
-> WarningFlag
-> (Bool -> DynP ())
-> GhcFlagMode
-> FlagSpec WarningFlag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name WarningFlag
flag Bool -> DynP ()
act GhcFlagMode
AllModes)
| String
name <- NonEmpty String -> [String]
forall a. NonEmpty a -> [a]
NE.toList (WarningFlag -> NonEmpty String
warnFlagNames WarningFlag
flag)
]
depFlagSpecOp :: String -> flag -> (TurnOnFlag -> DynP ()) -> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp :: String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp String
name flag
flag Bool -> DynP ()
act String
dep =
(Deprecation
Deprecated, (Deprecation, FlagSpec flag) -> FlagSpec flag
forall a b. (a, b) -> b
snd (String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
name flag
flag (\Bool
f -> Bool -> DynP ()
act Bool
f DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
dep)))
depFlagSpec :: String -> flag -> String
-> (Deprecation, FlagSpec flag)
depFlagSpec :: String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec String
name flag
flag String
dep = String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp String
name flag
flag Bool -> DynP ()
nop String
dep
depWarnSpec :: WarningFlag -> String
-> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec :: WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
flag String
dep = [ String
-> WarningFlag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec WarningFlag)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp String
name WarningFlag
flag Bool -> DynP ()
nop String
dep
| String
name <- NonEmpty String -> [String]
forall a. NonEmpty a -> [a]
NE.toList (WarningFlag -> NonEmpty String
warnFlagNames WarningFlag
flag)
]
subWarnSpec :: String -> WarningFlag -> String
-> [(Deprecation, FlagSpec WarningFlag)]
subWarnSpec :: String
-> WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
subWarnSpec String
oldname WarningFlag
flag String
dep = [ String
-> WarningFlag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec WarningFlag)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp String
oldname WarningFlag
flag Bool -> DynP ()
nop String
dep ]
depFlagSpecOp' :: String
-> flag
-> (TurnOnFlag -> DynP ())
-> (TurnOnFlag -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' :: String
-> flag
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' String
name flag
flag Bool -> DynP ()
act Bool -> String
dep =
(Deprecation
Deprecated, String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name flag
flag (\Bool
f -> Bool -> DynP ()
act Bool
f DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ Bool -> String
dep Bool
f))
GhcFlagMode
AllModes)
depFlagSpec' :: String
-> flag
-> (TurnOnFlag -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpec' :: String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
name flag
flag Bool -> String
dep = String
-> flag
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec flag)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' String
name flag
flag Bool -> DynP ()
nop Bool -> String
dep
depFlagSpecCond :: String
-> flag
-> (TurnOnFlag -> Bool)
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecCond :: String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond String
name flag
flag Bool -> Bool
cond String
dep =
(Deprecation
Deprecated, String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name flag
flag (\Bool
f -> Bool -> DynP () -> DynP ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Bool -> Bool
cond Bool
f) (DynP () -> DynP ()) -> DynP () -> DynP ()
forall a b. (a -> b) -> a -> b
$ String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate String
dep)
GhcFlagMode
AllModes)
flagGhciSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
name flag
flag = String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagGhciSpec' String
name flag
flag Bool -> DynP ()
nop
flagGhciSpec' :: String -> flag -> (TurnOnFlag -> DynP ())
-> (Deprecation, FlagSpec flag)
flagGhciSpec' :: String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagGhciSpec' String
name flag
flag Bool -> DynP ()
act = (Deprecation
NotDeprecated, String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name flag
flag Bool -> DynP ()
act GhcFlagMode
OnlyGhci)
flagHiddenSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec :: String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec String
name flag
flag = String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagHiddenSpec' String
name flag
flag Bool -> DynP ()
nop
flagHiddenSpec' :: String -> flag -> (TurnOnFlag -> DynP ())
-> (Deprecation, FlagSpec flag)
flagHiddenSpec' :: String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagHiddenSpec' String
name flag
flag Bool -> DynP ()
act = (Deprecation
NotDeprecated, String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
forall flag.
String -> flag -> (Bool -> DynP ()) -> GhcFlagMode -> FlagSpec flag
FlagSpec String
name flag
flag Bool -> DynP ()
act
GhcFlagMode
HiddenFlag)
hideFlag :: (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag :: (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag (Deprecation
dep, FlagSpec a
fs) = (Deprecation
dep, FlagSpec a
fs { flagSpecGhcMode :: GhcFlagMode
flagSpecGhcMode = GhcFlagMode
HiddenFlag })
mkFlag :: TurnOnFlag
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag :: Bool
-> String
-> (flag -> DynP ())
-> (Deprecation, FlagSpec flag)
-> (Deprecation, Flag (CmdLineP DynFlags))
mkFlag Bool
turn_on String
flagPrefix flag -> DynP ()
f (Deprecation
dep, (FlagSpec String
name flag
flag Bool -> DynP ()
extra_action GhcFlagMode
mode))
= (Deprecation
dep,
String
-> OptKind (CmdLineP DynFlags)
-> GhcFlagMode
-> Flag (CmdLineP DynFlags)
forall (m :: * -> *). String -> OptKind m -> GhcFlagMode -> Flag m
Flag (String
flagPrefix String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
name) (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (flag -> DynP ()
f flag
flag DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Bool -> DynP ()
extra_action Bool
turn_on)) GhcFlagMode
mode)
deprecate :: Monad m => String -> EwM m ()
deprecate :: String -> EwM m ()
deprecate String
s = do
String
arg <- EwM m String
forall (m :: * -> *). Monad m => EwM m String
getArg
DiagnosticReason -> String -> EwM m ()
forall (m :: * -> *).
Monad m =>
DiagnosticReason -> String -> EwM m ()
addFlagWarn (WarningFlag -> DiagnosticReason
WarningWithFlag WarningFlag
Opt_WarnDeprecatedFlags) (String
arg String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" is deprecated: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s)
deprecatedForExtension :: String -> TurnOnFlag -> String
deprecatedForExtension :: String -> Bool -> String
deprecatedForExtension String
lang Bool
turn_on
= String
"use -X" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
" or pragma {-# LANGUAGE " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" #-} instead"
where
flag :: String
flag | Bool
turn_on = String
lang
| Bool
otherwise = String
"No" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
lang
useInstead :: String -> String -> TurnOnFlag -> String
useInstead :: String -> String -> Bool -> String
useInstead String
prefix String
flag Bool
turn_on
= String
"Use " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
prefix String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
no String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" instead"
where
no :: String
no = if Bool
turn_on then String
"" else String
"no-"
nop :: TurnOnFlag -> DynP ()
nop :: Bool -> DynP ()
nop Bool
_ = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
flagSpecOf :: WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf :: WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf = (WarningFlag
-> Map WarningFlag (FlagSpec WarningFlag)
-> Maybe (FlagSpec WarningFlag))
-> Map WarningFlag (FlagSpec WarningFlag)
-> WarningFlag
-> Maybe (FlagSpec WarningFlag)
forall a b c. (a -> b -> c) -> b -> a -> c
flip WarningFlag
-> Map WarningFlag (FlagSpec WarningFlag)
-> Maybe (FlagSpec WarningFlag)
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup Map WarningFlag (FlagSpec WarningFlag)
wWarningFlagMap
wWarningFlagMap :: Map.Map WarningFlag (FlagSpec WarningFlag)
wWarningFlagMap :: Map WarningFlag (FlagSpec WarningFlag)
wWarningFlagMap = (FlagSpec WarningFlag
-> FlagSpec WarningFlag -> FlagSpec WarningFlag)
-> [(WarningFlag, FlagSpec WarningFlag)]
-> Map WarningFlag (FlagSpec WarningFlag)
forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
Map.fromListWith (\FlagSpec WarningFlag
_ FlagSpec WarningFlag
x -> FlagSpec WarningFlag
x) ([(WarningFlag, FlagSpec WarningFlag)]
-> Map WarningFlag (FlagSpec WarningFlag))
-> [(WarningFlag, FlagSpec WarningFlag)]
-> Map WarningFlag (FlagSpec WarningFlag)
forall a b. (a -> b) -> a -> b
$ (FlagSpec WarningFlag -> (WarningFlag, FlagSpec WarningFlag))
-> [FlagSpec WarningFlag] -> [(WarningFlag, FlagSpec WarningFlag)]
forall a b. (a -> b) -> [a] -> [b]
map (FlagSpec WarningFlag -> WarningFlag
forall flag. FlagSpec flag -> flag
flagSpecFlag (FlagSpec WarningFlag -> WarningFlag)
-> (FlagSpec WarningFlag -> FlagSpec WarningFlag)
-> FlagSpec WarningFlag
-> (WarningFlag, FlagSpec WarningFlag)
forall (a :: * -> * -> *) b c c'.
Arrow a =>
a b c -> a b c' -> a b (c, c')
&&& FlagSpec WarningFlag -> FlagSpec WarningFlag
forall a. a -> a
id) [FlagSpec WarningFlag]
wWarningFlags
wWarningFlags :: [FlagSpec WarningFlag]
wWarningFlags :: [FlagSpec WarningFlag]
wWarningFlags = ((Deprecation, FlagSpec WarningFlag) -> FlagSpec WarningFlag)
-> [(Deprecation, FlagSpec WarningFlag)] -> [FlagSpec WarningFlag]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, FlagSpec WarningFlag) -> FlagSpec WarningFlag
forall a b. (a, b) -> b
snd (((Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag) -> Ordering)
-> [(Deprecation, FlagSpec WarningFlag)]
-> [(Deprecation, FlagSpec WarningFlag)]
forall a. (a -> a -> Ordering) -> [a] -> [a]
sortBy (((Deprecation, FlagSpec WarningFlag) -> Deprecation)
-> (Deprecation, FlagSpec WarningFlag)
-> (Deprecation, FlagSpec WarningFlag)
-> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing (Deprecation, FlagSpec WarningFlag) -> Deprecation
forall a b. (a, b) -> a
fst) [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps)
wWarningFlagsDeps :: [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps :: [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps = [[(Deprecation, FlagSpec WarningFlag)]]
-> [(Deprecation, FlagSpec WarningFlag)]
forall a. Monoid a => [a] -> a
mconcat [
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnAmbiguousFields,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnAutoOrphans
String
"it has no effect",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnCPPUndef,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnbangedStrictPatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDeferredTypeErrors,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDeferredOutOfScopeVariables,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnWarningsDeprecations,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDeprecatedFlags,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDerivingDefaults,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDerivingTypeable,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDodgyExports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDodgyForeignImports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDodgyImports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnEmptyEnumerations,
String
-> WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
subWarnSpec String
"duplicate-constraints"
WarningFlag
Opt_WarnDuplicateConstraints
String
"it is subsumed by -Wredundant-constraints",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnRedundantConstraints,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnDuplicateExports,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnHiShadows
String
"it is not used, and was never implemented",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnInaccessibleCode,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnImplicitPrelude,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnImplicitKindVars
String
"it is now an error",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnIncompletePatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnIncompletePatternsRecUpd,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnIncompleteUniPatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnInlineRuleShadowing,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnIdentities,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingFields,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingImportList,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingExportList,
String
-> WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
subWarnSpec String
"missing-local-sigs"
WarningFlag
Opt_WarnMissingLocalSignatures
String
"it is replaced by -Wmissing-local-signatures",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingLocalSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingMethods,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnMissingMonadFailInstances
String
"fail is no longer a method of Monad",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnSemigroup,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingKindSignatures,
String
-> WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
subWarnSpec String
"missing-exported-sigs"
WarningFlag
Opt_WarnMissingExportedSignatures
String
"it is replaced by -Wmissing-exported-signatures",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingExportedSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMonomorphism,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnNameShadowing,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnNonCanonicalMonadInstances,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnNonCanonicalMonadFailInstances
String
"fail is no longer a method of Monad",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnNonCanonicalMonoidInstances,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnOrphans,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnOverflowedLiterals,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnOverlappingPatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissedSpecs,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnAllMissedSpecs,
WarningFlag
-> (Bool -> DynP ()) -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec' WarningFlag
Opt_WarnSafe Bool -> DynP ()
setWarnSafe,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTrustworthySafe,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnInferredSafeImports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingSafeHaskellMode,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTabs,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTypeDefaults,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTypedHoles,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnPartialTypeSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnrecognisedPragmas,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMisplacedPragmas,
WarningFlag
-> (Bool -> DynP ()) -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec' WarningFlag
Opt_WarnUnsafe Bool -> DynP ()
setWarnUnsafe,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnsupportedCallingConventions,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnsupportedLlvmVersion,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissedExtraSharedLib,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUntickedPromotedConstructors,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedDoBind,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedForalls,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedImports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedLocalBinds,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedMatches,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedPatternBinds,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedTopBinds,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedTypePatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedRecordWildcards,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnRedundantBangPatterns,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnRedundantRecordWildcards,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnRedundantStrictnessFlags,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnWrongDoBind,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingPatternSynonymSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingDerivingStrategies,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnSimplifiableClassConstraints,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingHomeModules,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnrecognisedWarningFlags,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnStarBinder,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnStarIsType,
WarningFlag -> String -> [(Deprecation, FlagSpec WarningFlag)]
depWarnSpec WarningFlag
Opt_WarnSpaceAfterBang
String
"bang patterns can no longer be written with a space",
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnPartialFields,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnPrepositiveQualifiedModule,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnusedPackages,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnCompatUnqualifiedImports,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnInvalidHaddock,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnOperatorWhitespaceExtConflict,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnOperatorWhitespace,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnImplicitLift,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnMissingExportedPatternSynonymSignatures,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnForallIdentifier,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnUnicodeBidirectionalFormatCharacters,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnGADTMonoLocalBinds,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTypeEqualityOutOfScope,
WarningFlag -> [(Deprecation, FlagSpec WarningFlag)]
warnSpec WarningFlag
Opt_WarnTypeEqualityRequiresOperators
]
negatableFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps = [
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"ignore-dot-ghci" GeneralFlag
Opt_IgnoreDotGhci ]
dFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
dFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
dFlagsDeps = [
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ppr-case-as-let" GeneralFlag
Opt_PprCaseAsLet,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"ppr-ticks" GeneralFlag
Opt_PprShowTicks
(\Bool
turn_on -> String -> String -> Bool -> String
useInstead String
"-d" String
"suppress-ticks" (Bool -> Bool
not Bool
turn_on)),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-ticks" GeneralFlag
Opt_SuppressTicks,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"suppress-stg-free-vars" GeneralFlag
Opt_SuppressStgExts
(String -> String -> Bool -> String
useInstead String
"-d" String
"suppress-stg-exts"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-stg-exts" GeneralFlag
Opt_SuppressStgExts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-coercions" GeneralFlag
Opt_SuppressCoercions,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-idinfo" GeneralFlag
Opt_SuppressIdInfo,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-unfoldings" GeneralFlag
Opt_SuppressUnfoldings,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-module-prefixes" GeneralFlag
Opt_SuppressModulePrefixes,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-timestamps" GeneralFlag
Opt_SuppressTimestamps,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-type-applications" GeneralFlag
Opt_SuppressTypeApplications,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-type-signatures" GeneralFlag
Opt_SuppressTypeSignatures,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-uniques" GeneralFlag
Opt_SuppressUniques,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-var-kinds" GeneralFlag
Opt_SuppressVarKinds,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"suppress-core-sizes" GeneralFlag
Opt_SuppressCoreSizes
]
fFlags :: [FlagSpec GeneralFlag]
fFlags :: [FlagSpec GeneralFlag]
fFlags = ((Deprecation, FlagSpec GeneralFlag) -> FlagSpec GeneralFlag)
-> [(Deprecation, FlagSpec GeneralFlag)] -> [FlagSpec GeneralFlag]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, FlagSpec GeneralFlag) -> FlagSpec GeneralFlag
forall a b. (a, b) -> b
snd [(Deprecation, FlagSpec GeneralFlag)]
fFlagsDeps
fFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
fFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
fFlagsDeps = [
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"asm-shortcutting" GeneralFlag
Opt_AsmShortcutting,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"break-on-error" GeneralFlag
Opt_BreakOnError,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"break-on-exception" GeneralFlag
Opt_BreakOnException,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"building-cabal-package" GeneralFlag
Opt_BuildingCabalPackage,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"call-arity" GeneralFlag
Opt_CallArity,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"exitification" GeneralFlag
Opt_Exitification,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"case-merge" GeneralFlag
Opt_CaseMerge,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"case-folding" GeneralFlag
Opt_CaseFolding,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cmm-elim-common-blocks" GeneralFlag
Opt_CmmElimCommonBlocks,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cmm-sink" GeneralFlag
Opt_CmmSink,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cmm-static-pred" GeneralFlag
Opt_CmmStaticPred,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cse" GeneralFlag
Opt_CSE,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"stg-cse" GeneralFlag
Opt_StgCSE,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"stg-lift-lams" GeneralFlag
Opt_StgLiftLams,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cpr-anal" GeneralFlag
Opt_CprAnal,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"defer-diagnostics" GeneralFlag
Opt_DeferDiagnostics,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"defer-type-errors" GeneralFlag
Opt_DeferTypeErrors,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"defer-typed-holes" GeneralFlag
Opt_DeferTypedHoles,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"defer-out-of-scope-variables" GeneralFlag
Opt_DeferOutOfScopeVariables,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"diagnostics-show-caret" GeneralFlag
Opt_DiagnosticsShowCaret,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"dump-with-ways" GeneralFlag
Opt_DumpWithWays,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"dicts-cheap" GeneralFlag
Opt_DictsCheap,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"dicts-strict" GeneralFlag
Opt_DictsStrict,
String
-> GeneralFlag -> String -> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec String
"dmd-tx-dict-sel"
GeneralFlag
Opt_DmdTxDictSel String
"effect is now unconditionally enabled",
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"do-eta-reduction" GeneralFlag
Opt_DoEtaReduction,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"do-lambda-eta-expansion" GeneralFlag
Opt_DoLambdaEtaExpansion,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"eager-blackholing" GeneralFlag
Opt_EagerBlackHoling,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"embed-manifest" GeneralFlag
Opt_EmbedManifest,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"enable-rewrite-rules" GeneralFlag
Opt_EnableRewriteRules,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"enable-th-splice-warnings" GeneralFlag
Opt_EnableThSpliceWarnings,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"error-spans" GeneralFlag
Opt_ErrorSpans,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"excess-precision" GeneralFlag
Opt_ExcessPrecision,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"expose-all-unfoldings" GeneralFlag
Opt_ExposeAllUnfoldings,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"expose-internal-symbols" GeneralFlag
Opt_ExposeInternalSymbols,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"external-dynamic-refs" GeneralFlag
Opt_ExternalDynamicRefs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"external-interpreter" GeneralFlag
Opt_ExternalInterpreter,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"family-application-cache" GeneralFlag
Opt_FamAppCache,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"float-in" GeneralFlag
Opt_FloatIn,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"force-recomp" GeneralFlag
Opt_ForceRecomp,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ignore-optim-changes" GeneralFlag
Opt_IgnoreOptimChanges,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ignore-hpc-changes" GeneralFlag
Opt_IgnoreHpcChanges,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"full-laziness" GeneralFlag
Opt_FullLaziness,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"fun-to-thunk" GeneralFlag
Opt_FunToThunk
(String -> String -> Bool -> String
useInstead String
"-f" String
"full-laziness"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"gen-manifest" GeneralFlag
Opt_GenManifest,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ghci-history" GeneralFlag
Opt_GhciHistory,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ghci-leak-check" GeneralFlag
Opt_GhciLeakCheck,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"validate-ide-info" GeneralFlag
Opt_ValidateHie,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"local-ghci-history" GeneralFlag
Opt_LocalGhciHistory,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"no-it" GeneralFlag
Opt_NoIt,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ghci-sandbox" GeneralFlag
Opt_GhciSandbox,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"helpful-errors" GeneralFlag
Opt_HelpfulErrors,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"hpc" GeneralFlag
Opt_Hpc,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ignore-asserts" GeneralFlag
Opt_IgnoreAsserts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ignore-interface-pragmas" GeneralFlag
Opt_IgnoreInterfacePragmas,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"implicit-import-qualified" GeneralFlag
Opt_ImplicitImportQualified,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"irrefutable-tuples" GeneralFlag
Opt_IrrefutableTuples,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"keep-going" GeneralFlag
Opt_KeepGoing,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"late-dmd-anal" GeneralFlag
Opt_LateDmdAnal,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"late-specialise" GeneralFlag
Opt_LateSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"liberate-case" GeneralFlag
Opt_LiberateCase,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec String
"llvm-tbaa" GeneralFlag
Opt_LlvmTBAA,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec String
"llvm-fill-undef-with-garbage" GeneralFlag
Opt_LlvmFillUndefWithGarbage,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"loopification" GeneralFlag
Opt_Loopification,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"block-layout-cfg" GeneralFlag
Opt_CfgBlocklayout,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"block-layout-weightless" GeneralFlag
Opt_WeightlessBlocklayout,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"omit-interface-pragmas" GeneralFlag
Opt_OmitInterfacePragmas,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"omit-yields" GeneralFlag
Opt_OmitYields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"optimal-applicative-do" GeneralFlag
Opt_OptimalApplicativeDo,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"pedantic-bottoms" GeneralFlag
Opt_PedanticBottoms,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"pre-inlining" GeneralFlag
Opt_SimplPreInlining,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"print-bind-contents" GeneralFlag
Opt_PrintBindContents,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"print-bind-result" GeneralFlag
Opt_PrintBindResult,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec String
"print-evld-with-show" GeneralFlag
Opt_PrintEvldWithShow,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-explicit-foralls" GeneralFlag
Opt_PrintExplicitForalls,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-explicit-kinds" GeneralFlag
Opt_PrintExplicitKinds,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-explicit-coercions" GeneralFlag
Opt_PrintExplicitCoercions,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-explicit-runtime-reps" GeneralFlag
Opt_PrintExplicitRuntimeReps,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-equality-relations" GeneralFlag
Opt_PrintEqualityRelations,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-axiom-incomps" GeneralFlag
Opt_PrintAxiomIncomps,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-unicode-syntax" GeneralFlag
Opt_PrintUnicodeSyntax,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-expanded-synonyms" GeneralFlag
Opt_PrintExpandedSynonyms,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-potential-instances" GeneralFlag
Opt_PrintPotentialInstances,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"print-typechecker-elaboration" GeneralFlag
Opt_PrintTypecheckerElaboration,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"prof-cafs" GeneralFlag
Opt_AutoSccsOnIndividualCafs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"prof-count-entries" GeneralFlag
Opt_ProfCountEntries,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"prof-late" GeneralFlag
Opt_ProfLateCcs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"prof-manual" GeneralFlag
Opt_ProfManualCcs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"regs-graph" GeneralFlag
Opt_RegsGraph,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"regs-iterative" GeneralFlag
Opt_RegsIterative,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"rewrite-rules" GeneralFlag
Opt_EnableRewriteRules
(String -> String -> Bool -> String
useInstead String
"-f" String
"enable-rewrite-rules"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"shared-implib" GeneralFlag
Opt_SharedImplib,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"spec-constr" GeneralFlag
Opt_SpecConstr,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"spec-constr-keen" GeneralFlag
Opt_SpecConstrKeen,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"specialise" GeneralFlag
Opt_Specialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"specialize" GeneralFlag
Opt_Specialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"specialise-aggressively" GeneralFlag
Opt_SpecialiseAggressively,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"specialize-aggressively" GeneralFlag
Opt_SpecialiseAggressively,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cross-module-specialise" GeneralFlag
Opt_CrossModuleSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cross-module-specialize" GeneralFlag
Opt_CrossModuleSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"inline-generics" GeneralFlag
Opt_InlineGenerics,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"inline-generics-aggressively" GeneralFlag
Opt_InlineGenericsAggressively,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"static-argument-transformation" GeneralFlag
Opt_StaticArgumentTransformation,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"strictness" GeneralFlag
Opt_Strictness,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"use-rpaths" GeneralFlag
Opt_RPath,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"write-interface" GeneralFlag
Opt_WriteInterface,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"write-ide-info" GeneralFlag
Opt_WriteHie,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"unbox-small-strict-fields" GeneralFlag
Opt_UnboxSmallStrictFields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"unbox-strict-fields" GeneralFlag
Opt_UnboxStrictFields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"version-macros" GeneralFlag
Opt_VersionMacros,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"worker-wrapper" GeneralFlag
Opt_WorkerWrapper,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"worker-wrapper-cbv" GeneralFlag
Opt_WorkerWrapperUnlift,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"solve-constant-dicts" GeneralFlag
Opt_SolveConstantDicts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"catch-nonexhaustive-cases" GeneralFlag
Opt_CatchNonexhaustiveCases,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"alignment-sanitisation" GeneralFlag
Opt_AlignmentSanitisation,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"check-prim-bounds" GeneralFlag
Opt_DoBoundsChecking,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"num-constant-folding" GeneralFlag
Opt_NumConstantFolding,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"core-constant-folding" GeneralFlag
Opt_CoreConstantFolding,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"fast-pap-calls" GeneralFlag
Opt_FastPAPCalls,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"cmm-control-flow" GeneralFlag
Opt_CmmControlFlow,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-warning-groups" GeneralFlag
Opt_ShowWarnGroups,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"hide-source-paths" GeneralFlag
Opt_HideSourcePaths,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-loaded-modules" GeneralFlag
Opt_ShowLoadedModules,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"whole-archive-hs-libs" GeneralFlag
Opt_WholeArchiveHsLibs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"keep-cafs" GeneralFlag
Opt_KeepCAFs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"link-rts" GeneralFlag
Opt_LinkRts
]
[(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, FlagSpec GeneralFlag)]
-> [(Deprecation, FlagSpec GeneralFlag)]
forall a. [a] -> [a] -> [a]
++ [(Deprecation, FlagSpec GeneralFlag)]
fHoleFlags
fHoleFlags :: [(Deprecation, FlagSpec GeneralFlag)]
fHoleFlags :: [(Deprecation, FlagSpec GeneralFlag)]
fHoleFlags = [
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-hole-constraints" GeneralFlag
Opt_ShowHoleConstraints,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"show-valid-substitutions" GeneralFlag
Opt_ShowValidHoleFits
(String -> String -> Bool -> String
useInstead String
"-f" String
"show-valid-hole-fits"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-valid-hole-fits" GeneralFlag
Opt_ShowValidHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"sort-valid-hole-fits" GeneralFlag
Opt_SortValidHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"sort-by-size-hole-fits" GeneralFlag
Opt_SortBySizeHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"sort-by-subsumption-hole-fits" GeneralFlag
Opt_SortBySubsumHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"abstract-refinement-hole-fits" GeneralFlag
Opt_AbstractRefHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-hole-matches-of-hole-fits" GeneralFlag
Opt_ShowMatchesOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-provenance-of-hole-fits" GeneralFlag
Opt_ShowProvOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-type-of-hole-fits" GeneralFlag
Opt_ShowTypeOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-type-app-of-hole-fits" GeneralFlag
Opt_ShowTypeAppOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-type-app-vars-of-hole-fits" GeneralFlag
Opt_ShowTypeAppVarsOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"show-docs-of-hole-fits" GeneralFlag
Opt_ShowDocsOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"unclutter-valid-hole-fits" GeneralFlag
Opt_UnclutterValidHoleFits
]
fLangFlags :: [FlagSpec LangExt.Extension]
fLangFlags :: [FlagSpec Extension]
fLangFlags = ((Deprecation, FlagSpec Extension) -> FlagSpec Extension)
-> [(Deprecation, FlagSpec Extension)] -> [FlagSpec Extension]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, FlagSpec Extension) -> FlagSpec Extension
forall a b. (a, b) -> b
snd [(Deprecation, FlagSpec Extension)]
fLangFlagsDeps
fLangFlagsDeps :: [(Deprecation, FlagSpec LangExt.Extension)]
fLangFlagsDeps :: [(Deprecation, FlagSpec Extension)]
fLangFlagsDeps = [
String
-> Extension
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' String
"th" Extension
LangExt.TemplateHaskell
Bool -> DynP ()
checkTemplateHaskellOk
(String -> Bool -> String
deprecatedForExtension String
"TemplateHaskell"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"fi" Extension
LangExt.ForeignFunctionInterface
(String -> Bool -> String
deprecatedForExtension String
"ForeignFunctionInterface"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"ffi" Extension
LangExt.ForeignFunctionInterface
(String -> Bool -> String
deprecatedForExtension String
"ForeignFunctionInterface"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"arrows" Extension
LangExt.Arrows
(String -> Bool -> String
deprecatedForExtension String
"Arrows"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"implicit-prelude" Extension
LangExt.ImplicitPrelude
(String -> Bool -> String
deprecatedForExtension String
"ImplicitPrelude"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"bang-patterns" Extension
LangExt.BangPatterns
(String -> Bool -> String
deprecatedForExtension String
"BangPatterns"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"monomorphism-restriction" Extension
LangExt.MonomorphismRestriction
(String -> Bool -> String
deprecatedForExtension String
"MonomorphismRestriction"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"extended-default-rules" Extension
LangExt.ExtendedDefaultRules
(String -> Bool -> String
deprecatedForExtension String
"ExtendedDefaultRules"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"implicit-params" Extension
LangExt.ImplicitParams
(String -> Bool -> String
deprecatedForExtension String
"ImplicitParams"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"scoped-type-variables" Extension
LangExt.ScopedTypeVariables
(String -> Bool -> String
deprecatedForExtension String
"ScopedTypeVariables"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"allow-overlapping-instances" Extension
LangExt.OverlappingInstances
(String -> Bool -> String
deprecatedForExtension String
"OverlappingInstances"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"allow-undecidable-instances" Extension
LangExt.UndecidableInstances
(String -> Bool -> String
deprecatedForExtension String
"UndecidableInstances"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"allow-incoherent-instances" Extension
LangExt.IncoherentInstances
(String -> Bool -> String
deprecatedForExtension String
"IncoherentInstances")
]
supportedLanguages :: [String]
supportedLanguages :: [String]
supportedLanguages = ((Deprecation, FlagSpec Language) -> String)
-> [(Deprecation, FlagSpec Language)] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (FlagSpec Language -> String
forall flag. FlagSpec flag -> String
flagSpecName (FlagSpec Language -> String)
-> ((Deprecation, FlagSpec Language) -> FlagSpec Language)
-> (Deprecation, FlagSpec Language)
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Deprecation, FlagSpec Language) -> FlagSpec Language
forall a b. (a, b) -> b
snd) [(Deprecation, FlagSpec Language)]
languageFlagsDeps
supportedLanguageOverlays :: [String]
supportedLanguageOverlays :: [String]
supportedLanguageOverlays = ((Deprecation, FlagSpec SafeHaskellMode) -> String)
-> [(Deprecation, FlagSpec SafeHaskellMode)] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (FlagSpec SafeHaskellMode -> String
forall flag. FlagSpec flag -> String
flagSpecName (FlagSpec SafeHaskellMode -> String)
-> ((Deprecation, FlagSpec SafeHaskellMode)
-> FlagSpec SafeHaskellMode)
-> (Deprecation, FlagSpec SafeHaskellMode)
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Deprecation, FlagSpec SafeHaskellMode) -> FlagSpec SafeHaskellMode
forall a b. (a, b) -> b
snd) [(Deprecation, FlagSpec SafeHaskellMode)]
safeHaskellFlagsDeps
supportedExtensions :: ArchOS -> [String]
supportedExtensions :: ArchOS -> [String]
supportedExtensions (ArchOS Arch
_ OS
os) = (FlagSpec Extension -> [String])
-> [FlagSpec Extension] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap FlagSpec Extension -> [String]
toFlagSpecNamePair [FlagSpec Extension]
xFlags
where
toFlagSpecNamePair :: FlagSpec Extension -> [String]
toFlagSpecNamePair FlagSpec Extension
flg
| Bool
isAIX, FlagSpec Extension -> Extension
forall flag. FlagSpec flag -> flag
flagSpecFlag FlagSpec Extension
flg Extension -> Extension -> Bool
forall a. Eq a => a -> a -> Bool
== Extension
LangExt.TemplateHaskell = [String
noName]
| Bool
isAIX, FlagSpec Extension -> Extension
forall flag. FlagSpec flag -> flag
flagSpecFlag FlagSpec Extension
flg Extension -> Extension -> Bool
forall a. Eq a => a -> a -> Bool
== Extension
LangExt.QuasiQuotes = [String
noName]
| Bool
otherwise = [String
name, String
noName]
where
isAIX :: Bool
isAIX = OS
os OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSAIX
noName :: String
noName = String
"No" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
name
name :: String
name = FlagSpec Extension -> String
forall flag. FlagSpec flag -> String
flagSpecName FlagSpec Extension
flg
supportedLanguagesAndExtensions :: ArchOS -> [String]
supportedLanguagesAndExtensions :: ArchOS -> [String]
supportedLanguagesAndExtensions ArchOS
arch_os =
[String]
supportedLanguages [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
supportedLanguageOverlays [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ ArchOS -> [String]
supportedExtensions ArchOS
arch_os
languageFlagsDeps :: [(Deprecation, FlagSpec Language)]
languageFlagsDeps :: [(Deprecation, FlagSpec Language)]
languageFlagsDeps = [
String -> Language -> (Deprecation, FlagSpec Language)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"Haskell98" Language
Haskell98,
String -> Language -> (Deprecation, FlagSpec Language)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"Haskell2010" Language
Haskell2010,
String -> Language -> (Deprecation, FlagSpec Language)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"GHC2021" Language
GHC2021
]
safeHaskellFlagsDeps :: [(Deprecation, FlagSpec SafeHaskellMode)]
safeHaskellFlagsDeps :: [(Deprecation, FlagSpec SafeHaskellMode)]
safeHaskellFlagsDeps = [SafeHaskellMode -> (Deprecation, FlagSpec SafeHaskellMode)
forall flag. Show flag => flag -> (Deprecation, FlagSpec flag)
mkF SafeHaskellMode
Sf_Unsafe, SafeHaskellMode -> (Deprecation, FlagSpec SafeHaskellMode)
forall flag. Show flag => flag -> (Deprecation, FlagSpec flag)
mkF SafeHaskellMode
Sf_Trustworthy, SafeHaskellMode -> (Deprecation, FlagSpec SafeHaskellMode)
forall flag. Show flag => flag -> (Deprecation, FlagSpec flag)
mkF SafeHaskellMode
Sf_Safe]
where mkF :: flag -> (Deprecation, FlagSpec flag)
mkF flag
flag = String -> flag -> (Deprecation, FlagSpec flag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec (flag -> String
forall a. Show a => a -> String
show flag
flag) flag
flag
xFlags :: [FlagSpec LangExt.Extension]
xFlags :: [FlagSpec Extension]
xFlags = ((Deprecation, FlagSpec Extension) -> FlagSpec Extension)
-> [(Deprecation, FlagSpec Extension)] -> [FlagSpec Extension]
forall a b. (a -> b) -> [a] -> [b]
map (Deprecation, FlagSpec Extension) -> FlagSpec Extension
forall a b. (a, b) -> b
snd [(Deprecation, FlagSpec Extension)]
xFlagsDeps
xFlagsDeps :: [(Deprecation, FlagSpec LangExt.Extension)]
xFlagsDeps :: [(Deprecation, FlagSpec Extension)]
xFlagsDeps = [
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"AllowAmbiguousTypes" Extension
LangExt.AllowAmbiguousTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"AlternativeLayoutRule" Extension
LangExt.AlternativeLayoutRule,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"AlternativeLayoutRuleTransitional"
Extension
LangExt.AlternativeLayoutRuleTransitional,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"Arrows" Extension
LangExt.Arrows,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond String
"AutoDeriveTypeable" Extension
LangExt.AutoDeriveTypeable
Bool -> Bool
forall a. a -> a
id
(String
"Typeable instances are created automatically " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"for all types since GHC 8.2."),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"BangPatterns" Extension
LangExt.BangPatterns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"BinaryLiterals" Extension
LangExt.BinaryLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"CApiFFI" Extension
LangExt.CApiFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"CPP" Extension
LangExt.Cpp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"CUSKs" Extension
LangExt.CUSKs,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ConstrainedClassMethods" Extension
LangExt.ConstrainedClassMethods,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ConstraintKinds" Extension
LangExt.ConstraintKinds,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DataKinds" Extension
LangExt.DataKinds,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond String
"DatatypeContexts" Extension
LangExt.DatatypeContexts
Bool -> Bool
forall a. a -> a
id
(String
"It was widely considered a misfeature, " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"and has been removed from the Haskell language."),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DefaultSignatures" Extension
LangExt.DefaultSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveAnyClass" Extension
LangExt.DeriveAnyClass,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveDataTypeable" Extension
LangExt.DeriveDataTypeable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveFoldable" Extension
LangExt.DeriveFoldable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveFunctor" Extension
LangExt.DeriveFunctor,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveGeneric" Extension
LangExt.DeriveGeneric,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveLift" Extension
LangExt.DeriveLift,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DeriveTraversable" Extension
LangExt.DeriveTraversable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DerivingStrategies" Extension
LangExt.DerivingStrategies,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
"DerivingVia" Extension
LangExt.DerivingVia
Bool -> DynP ()
setDeriveVia,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DisambiguateRecordFields" Extension
LangExt.DisambiguateRecordFields,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DoAndIfThenElse" Extension
LangExt.DoAndIfThenElse,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"BlockArguments" Extension
LangExt.BlockArguments,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"DoRec" Extension
LangExt.RecursiveDo
(String -> Bool -> String
deprecatedForExtension String
"RecursiveDo"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"DuplicateRecordFields" Extension
LangExt.DuplicateRecordFields,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"FieldSelectors" Extension
LangExt.FieldSelectors,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"EmptyCase" Extension
LangExt.EmptyCase,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"EmptyDataDecls" Extension
LangExt.EmptyDataDecls,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"EmptyDataDeriving" Extension
LangExt.EmptyDataDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ExistentialQuantification" Extension
LangExt.ExistentialQuantification,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ExplicitForAll" Extension
LangExt.ExplicitForAll,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ExplicitNamespaces" Extension
LangExt.ExplicitNamespaces,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ExtendedDefaultRules" Extension
LangExt.ExtendedDefaultRules,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"FlexibleContexts" Extension
LangExt.FlexibleContexts,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"FlexibleInstances" Extension
LangExt.FlexibleInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ForeignFunctionInterface" Extension
LangExt.ForeignFunctionInterface,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"FunctionalDependencies" Extension
LangExt.FunctionalDependencies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"GADTSyntax" Extension
LangExt.GADTSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"GADTs" Extension
LangExt.GADTs,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"GHCForeignImportPrim" Extension
LangExt.GHCForeignImportPrim,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
"GeneralizedNewtypeDeriving" Extension
LangExt.GeneralizedNewtypeDeriving
Bool -> DynP ()
setGenDeriving,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
"GeneralisedNewtypeDeriving" Extension
LangExt.GeneralizedNewtypeDeriving
Bool -> DynP ()
setGenDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ImplicitParams" Extension
LangExt.ImplicitParams,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ImplicitPrelude" Extension
LangExt.ImplicitPrelude,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ImportQualifiedPost" Extension
LangExt.ImportQualifiedPost,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ImpredicativeTypes" Extension
LangExt.ImpredicativeTypes,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
"IncoherentInstances" Extension
LangExt.IncoherentInstances
Bool -> DynP ()
setIncoherentInsts,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeFamilyDependencies" Extension
LangExt.TypeFamilyDependencies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"InstanceSigs" Extension
LangExt.InstanceSigs,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ApplicativeDo" Extension
LangExt.ApplicativeDo,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"InterruptibleFFI" Extension
LangExt.InterruptibleFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"JavaScriptFFI" Extension
LangExt.JavaScriptFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"KindSignatures" Extension
LangExt.KindSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"LambdaCase" Extension
LangExt.LambdaCase,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"LexicalNegation" Extension
LangExt.LexicalNegation,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"LiberalTypeSynonyms" Extension
LangExt.LiberalTypeSynonyms,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"LinearTypes" Extension
LangExt.LinearTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MagicHash" Extension
LangExt.MagicHash,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MonadComprehensions" Extension
LangExt.MonadComprehensions,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MonoLocalBinds" Extension
LangExt.MonoLocalBinds,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MonomorphismRestriction" Extension
LangExt.MonomorphismRestriction,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MultiParamTypeClasses" Extension
LangExt.MultiParamTypeClasses,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"MultiWayIf" Extension
LangExt.MultiWayIf,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NumericUnderscores" Extension
LangExt.NumericUnderscores,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NPlusKPatterns" Extension
LangExt.NPlusKPatterns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NamedFieldPuns" Extension
LangExt.NamedFieldPuns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NamedWildCards" Extension
LangExt.NamedWildCards,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NegativeLiterals" Extension
LangExt.NegativeLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"HexFloatLiterals" Extension
LangExt.HexFloatLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NondecreasingIndentation" Extension
LangExt.NondecreasingIndentation,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"NullaryTypeClasses" Extension
LangExt.NullaryTypeClasses
(String -> Bool -> String
deprecatedForExtension String
"MultiParamTypeClasses"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"NumDecimals" Extension
LangExt.NumDecimals,
String
-> Extension
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp String
"OverlappingInstances" Extension
LangExt.OverlappingInstances
Bool -> DynP ()
setOverlappingInsts
String
"instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"OverloadedLabels" Extension
LangExt.OverloadedLabels,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"OverloadedLists" Extension
LangExt.OverloadedLists,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"OverloadedStrings" Extension
LangExt.OverloadedStrings,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PackageImports" Extension
LangExt.PackageImports,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ParallelArrays" Extension
LangExt.ParallelArrays,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ParallelListComp" Extension
LangExt.ParallelListComp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PartialTypeSignatures" Extension
LangExt.PartialTypeSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PatternGuards" Extension
LangExt.PatternGuards,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"PatternSignatures" Extension
LangExt.ScopedTypeVariables
(String -> Bool -> String
deprecatedForExtension String
"ScopedTypeVariables"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PatternSynonyms" Extension
LangExt.PatternSynonyms,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PolyKinds" Extension
LangExt.PolyKinds,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PolymorphicComponents" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"QuantifiedConstraints" Extension
LangExt.QuantifiedConstraints,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"PostfixOperators" Extension
LangExt.PostfixOperators,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"QuasiQuotes" Extension
LangExt.QuasiQuotes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"QualifiedDo" Extension
LangExt.QualifiedDo,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"Rank2Types" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RankNTypes" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RebindableSyntax" Extension
LangExt.RebindableSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"OverloadedRecordDot" Extension
LangExt.OverloadedRecordDot,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"OverloadedRecordUpdate" Extension
LangExt.OverloadedRecordUpdate,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' String
"RecordPuns" Extension
LangExt.NamedFieldPuns
(String -> Bool -> String
deprecatedForExtension String
"NamedFieldPuns"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RecordWildCards" Extension
LangExt.RecordWildCards,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RecursiveDo" Extension
LangExt.RecursiveDo,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RelaxedLayout" Extension
LangExt.RelaxedLayout,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond String
"RelaxedPolyRec" Extension
LangExt.RelaxedPolyRec
Bool -> Bool
not
String
"You can't turn off RelaxedPolyRec any more",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"RoleAnnotations" Extension
LangExt.RoleAnnotations,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ScopedTypeVariables" Extension
LangExt.ScopedTypeVariables,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"StandaloneDeriving" Extension
LangExt.StandaloneDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"StarIsType" Extension
LangExt.StarIsType,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"StaticPointers" Extension
LangExt.StaticPointers,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"Strict" Extension
LangExt.Strict,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"StrictData" Extension
LangExt.StrictData,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' String
"TemplateHaskell" Extension
LangExt.TemplateHaskell
Bool -> DynP ()
checkTemplateHaskellOk,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TemplateHaskellQuotes" Extension
LangExt.TemplateHaskellQuotes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"StandaloneKindSignatures" Extension
LangExt.StandaloneKindSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TraditionalRecordSyntax" Extension
LangExt.TraditionalRecordSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TransformListComp" Extension
LangExt.TransformListComp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TupleSections" Extension
LangExt.TupleSections,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeApplications" Extension
LangExt.TypeApplications,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeInType" Extension
LangExt.TypeInType,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeFamilies" Extension
LangExt.TypeFamilies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeOperators" Extension
LangExt.TypeOperators,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"TypeSynonymInstances" Extension
LangExt.TypeSynonymInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnboxedTuples" Extension
LangExt.UnboxedTuples,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnboxedSums" Extension
LangExt.UnboxedSums,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UndecidableInstances" Extension
LangExt.UndecidableInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UndecidableSuperClasses" Extension
LangExt.UndecidableSuperClasses,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnicodeSyntax" Extension
LangExt.UnicodeSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnliftedDatatypes" Extension
LangExt.UnliftedDatatypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnliftedFFITypes" Extension
LangExt.UnliftedFFITypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"UnliftedNewtypes" Extension
LangExt.UnliftedNewtypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec String
"ViewPatterns" Extension
LangExt.ViewPatterns
]
defaultFlags :: Settings -> [GeneralFlag]
defaultFlags :: Settings -> [GeneralFlag]
defaultFlags Settings
settings
= [ GeneralFlag
Opt_AutoLinkPackages,
GeneralFlag
Opt_DiagnosticsShowCaret,
GeneralFlag
Opt_EmbedManifest,
GeneralFlag
Opt_FamAppCache,
GeneralFlag
Opt_GenManifest,
GeneralFlag
Opt_GhciHistory,
GeneralFlag
Opt_GhciSandbox,
GeneralFlag
Opt_HelpfulErrors,
GeneralFlag
Opt_KeepHiFiles,
GeneralFlag
Opt_KeepOFiles,
GeneralFlag
Opt_OmitYields,
GeneralFlag
Opt_PrintBindContents,
GeneralFlag
Opt_ProfCountEntries,
GeneralFlag
Opt_SharedImplib,
GeneralFlag
Opt_SimplPreInlining,
GeneralFlag
Opt_VersionMacros,
GeneralFlag
Opt_RPath,
GeneralFlag
Opt_DumpWithWays
]
[GeneralFlag] -> [GeneralFlag] -> [GeneralFlag]
forall a. [a] -> [a] -> [a]
++ [GeneralFlag
f | ([Int]
ns,GeneralFlag
f) <- [([Int], GeneralFlag)]
optLevelFlags, Int
0 Int -> [Int] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Int]
ns]
[GeneralFlag] -> [GeneralFlag] -> [GeneralFlag]
forall a. [a] -> [a] -> [a]
++ Platform -> [GeneralFlag]
default_PIC Platform
platform
[GeneralFlag] -> [GeneralFlag] -> [GeneralFlag]
forall a. [a] -> [a] -> [a]
++ [GeneralFlag]
validHoleFitDefaults
where platform :: Platform
platform = Settings -> Platform
sTargetPlatform Settings
settings
validHoleFitDefaults :: [GeneralFlag]
validHoleFitDefaults :: [GeneralFlag]
validHoleFitDefaults
= [ GeneralFlag
Opt_ShowTypeAppOfHoleFits
, GeneralFlag
Opt_ShowTypeOfHoleFits
, GeneralFlag
Opt_ShowProvOfHoleFits
, GeneralFlag
Opt_ShowMatchesOfHoleFits
, GeneralFlag
Opt_ShowValidHoleFits
, GeneralFlag
Opt_SortValidHoleFits
, GeneralFlag
Opt_SortBySizeHoleFits
, GeneralFlag
Opt_ShowHoleConstraints ]
validHoleFitsImpliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
validHoleFitsImpliedGFlags :: [(GeneralFlag, Bool, GeneralFlag)]
validHoleFitsImpliedGFlags
= [ (GeneralFlag
Opt_UnclutterValidHoleFits, Bool
turnOff, GeneralFlag
Opt_ShowTypeAppOfHoleFits)
, (GeneralFlag
Opt_UnclutterValidHoleFits, Bool
turnOff, GeneralFlag
Opt_ShowTypeAppVarsOfHoleFits)
, (GeneralFlag
Opt_UnclutterValidHoleFits, Bool
turnOff, GeneralFlag
Opt_ShowDocsOfHoleFits)
, (GeneralFlag
Opt_ShowTypeAppVarsOfHoleFits, Bool
turnOff, GeneralFlag
Opt_ShowTypeAppOfHoleFits)
, (GeneralFlag
Opt_UnclutterValidHoleFits, Bool
turnOff, GeneralFlag
Opt_ShowProvOfHoleFits) ]
default_PIC :: Platform -> [GeneralFlag]
default_PIC :: Platform -> [GeneralFlag]
default_PIC Platform
platform =
case (Platform -> OS
platformOS Platform
platform, Platform -> Arch
platformArch Platform
platform) of
(OS
OSDarwin, Arch
ArchX86_64) -> [GeneralFlag
Opt_PIC]
(OS
OSDarwin, Arch
ArchAArch64) -> [GeneralFlag
Opt_PIC]
(OS
OSLinux, Arch
ArchAArch64) -> [GeneralFlag
Opt_PIC, GeneralFlag
Opt_ExternalDynamicRefs]
(OS
OSLinux, ArchARM {}) -> [GeneralFlag
Opt_PIC, GeneralFlag
Opt_ExternalDynamicRefs]
(OS
OSOpenBSD, Arch
ArchX86_64) -> [GeneralFlag
Opt_PIC]
(OS, Arch)
_ -> []
impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
impliedGFlags :: [(GeneralFlag, Bool, GeneralFlag)]
impliedGFlags = [(GeneralFlag
Opt_DeferTypeErrors, Bool
turnOn, GeneralFlag
Opt_DeferTypedHoles)
,(GeneralFlag
Opt_DeferTypeErrors, Bool
turnOn, GeneralFlag
Opt_DeferOutOfScopeVariables)
,(GeneralFlag
Opt_DoLinearCoreLinting, Bool
turnOn, GeneralFlag
Opt_DoCoreLinting)
,(GeneralFlag
Opt_Strictness, Bool
turnOn, GeneralFlag
Opt_WorkerWrapper)
] [(GeneralFlag, Bool, GeneralFlag)]
-> [(GeneralFlag, Bool, GeneralFlag)]
-> [(GeneralFlag, Bool, GeneralFlag)]
forall a. [a] -> [a] -> [a]
++ [(GeneralFlag, Bool, GeneralFlag)]
validHoleFitsImpliedGFlags
impliedOffGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
impliedOffGFlags :: [(GeneralFlag, Bool, GeneralFlag)]
impliedOffGFlags = [(GeneralFlag
Opt_Strictness, Bool
turnOff, GeneralFlag
Opt_WorkerWrapper)]
impliedXFlags :: [(LangExt.Extension, TurnOnFlag, LangExt.Extension)]
impliedXFlags :: [(Extension, Bool, Extension)]
impliedXFlags
= [ (Extension
LangExt.RankNTypes, Bool
turnOn, Extension
LangExt.ExplicitForAll)
, (Extension
LangExt.QuantifiedConstraints, Bool
turnOn, Extension
LangExt.ExplicitForAll)
, (Extension
LangExt.ScopedTypeVariables, Bool
turnOn, Extension
LangExt.ExplicitForAll)
, (Extension
LangExt.LiberalTypeSynonyms, Bool
turnOn, Extension
LangExt.ExplicitForAll)
, (Extension
LangExt.ExistentialQuantification, Bool
turnOn, Extension
LangExt.ExplicitForAll)
, (Extension
LangExt.FlexibleInstances, Bool
turnOn, Extension
LangExt.TypeSynonymInstances)
, (Extension
LangExt.FunctionalDependencies, Bool
turnOn, Extension
LangExt.MultiParamTypeClasses)
, (Extension
LangExt.MultiParamTypeClasses, Bool
turnOn, Extension
LangExt.ConstrainedClassMethods)
, (Extension
LangExt.TypeFamilyDependencies, Bool
turnOn, Extension
LangExt.TypeFamilies)
, (Extension
LangExt.RebindableSyntax, Bool
turnOff, Extension
LangExt.ImplicitPrelude)
, (Extension
LangExt.DerivingVia, Bool
turnOn, Extension
LangExt.DerivingStrategies)
, (Extension
LangExt.GADTs, Bool
turnOn, Extension
LangExt.GADTSyntax)
, (Extension
LangExt.GADTs, Bool
turnOn, Extension
LangExt.MonoLocalBinds)
, (Extension
LangExt.TypeFamilies, Bool
turnOn, Extension
LangExt.MonoLocalBinds)
, (Extension
LangExt.TypeFamilies, Bool
turnOn, Extension
LangExt.KindSignatures)
, (Extension
LangExt.PolyKinds, Bool
turnOn, Extension
LangExt.KindSignatures)
, (Extension
LangExt.TypeInType, Bool
turnOn, Extension
LangExt.DataKinds)
, (Extension
LangExt.TypeInType, Bool
turnOn, Extension
LangExt.PolyKinds)
, (Extension
LangExt.TypeInType, Bool
turnOn, Extension
LangExt.KindSignatures)
, (Extension
LangExt.StandaloneKindSignatures, Bool
turnOff, Extension
LangExt.CUSKs)
, (Extension
LangExt.AutoDeriveTypeable, Bool
turnOn, Extension
LangExt.DeriveDataTypeable)
, (Extension
LangExt.TypeFamilies, Bool
turnOn, Extension
LangExt.ExplicitNamespaces)
, (Extension
LangExt.TypeOperators, Bool
turnOn, Extension
LangExt.ExplicitNamespaces)
, (Extension
LangExt.ImpredicativeTypes, Bool
turnOn, Extension
LangExt.RankNTypes)
, (Extension
LangExt.RecordWildCards, Bool
turnOn, Extension
LangExt.DisambiguateRecordFields)
, (Extension
LangExt.ParallelArrays, Bool
turnOn, Extension
LangExt.ParallelListComp)
, (Extension
LangExt.JavaScriptFFI, Bool
turnOn, Extension
LangExt.InterruptibleFFI)
, (Extension
LangExt.DeriveTraversable, Bool
turnOn, Extension
LangExt.DeriveFunctor)
, (Extension
LangExt.DeriveTraversable, Bool
turnOn, Extension
LangExt.DeriveFoldable)
, (Extension
LangExt.DuplicateRecordFields, Bool
turnOn, Extension
LangExt.DisambiguateRecordFields)
, (Extension
LangExt.TemplateHaskell, Bool
turnOn, Extension
LangExt.TemplateHaskellQuotes)
, (Extension
LangExt.Strict, Bool
turnOn, Extension
LangExt.StrictData)
, (Extension
LangExt.UnboxedTuples, Bool
turnOn, Extension
LangExt.UnboxedSums)
, (Extension
LangExt.UnliftedDatatypes, Bool
turnOn, Extension
LangExt.DataKinds)
, (Extension
LangExt.UnliftedDatatypes, Bool
turnOn, Extension
LangExt.StandaloneKindSignatures)
]
optLevelFlags :: [([Int], GeneralFlag)]
optLevelFlags :: [([Int], GeneralFlag)]
optLevelFlags
= [ ([Int
0,Int
1,Int
2], GeneralFlag
Opt_DoLambdaEtaExpansion)
, ([Int
0,Int
1,Int
2], GeneralFlag
Opt_DoEtaReduction)
, ([Int
0,Int
1,Int
2], GeneralFlag
Opt_LlvmTBAA)
, ([Int
0,Int
1,Int
2], GeneralFlag
Opt_ProfManualCcs )
, ([Int
2], GeneralFlag
Opt_DictsStrict)
, ([Int
0], GeneralFlag
Opt_IgnoreInterfacePragmas)
, ([Int
0], GeneralFlag
Opt_OmitInterfacePragmas)
, ([Int
1,Int
2], GeneralFlag
Opt_CoreConstantFolding)
, ([Int
1,Int
2], GeneralFlag
Opt_CallArity)
, ([Int
1,Int
2], GeneralFlag
Opt_Exitification)
, ([Int
1,Int
2], GeneralFlag
Opt_CaseMerge)
, ([Int
1,Int
2], GeneralFlag
Opt_CaseFolding)
, ([Int
1,Int
2], GeneralFlag
Opt_CmmElimCommonBlocks)
, ([Int
2], GeneralFlag
Opt_AsmShortcutting)
, ([Int
1,Int
2], GeneralFlag
Opt_CmmSink)
, ([Int
1,Int
2], GeneralFlag
Opt_CmmStaticPred)
, ([Int
1,Int
2], GeneralFlag
Opt_CSE)
, ([Int
1,Int
2], GeneralFlag
Opt_StgCSE)
, ([Int
2], GeneralFlag
Opt_StgLiftLams)
, ([Int
1,Int
2], GeneralFlag
Opt_CmmControlFlow)
, ([Int
1,Int
2], GeneralFlag
Opt_EnableRewriteRules)
, ([Int
1,Int
2], GeneralFlag
Opt_FloatIn)
, ([Int
1,Int
2], GeneralFlag
Opt_FullLaziness)
, ([Int
1,Int
2], GeneralFlag
Opt_IgnoreAsserts)
, ([Int
1,Int
2], GeneralFlag
Opt_Loopification)
, ([Int
1,Int
2], GeneralFlag
Opt_CfgBlocklayout)
, ([Int
1,Int
2], GeneralFlag
Opt_Specialise)
, ([Int
1,Int
2], GeneralFlag
Opt_CrossModuleSpecialise)
, ([Int
1,Int
2], GeneralFlag
Opt_InlineGenerics)
, ([Int
1,Int
2], GeneralFlag
Opt_Strictness)
, ([Int
1,Int
2], GeneralFlag
Opt_UnboxSmallStrictFields)
, ([Int
1,Int
2], GeneralFlag
Opt_CprAnal)
, ([Int
1,Int
2], GeneralFlag
Opt_WorkerWrapper)
, ([Int
1,Int
2], GeneralFlag
Opt_SolveConstantDicts)
, ([Int
1,Int
2], GeneralFlag
Opt_NumConstantFolding)
, ([Int
2], GeneralFlag
Opt_LiberateCase)
, ([Int
2], GeneralFlag
Opt_SpecConstr)
, ([Int
2], GeneralFlag
Opt_FastPAPCalls)
]
enableUnusedBinds :: DynP ()
enableUnusedBinds :: DynP ()
enableUnusedBinds = (WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
setWarningFlag [WarningFlag]
unusedBindsFlags
disableUnusedBinds :: DynP ()
disableUnusedBinds :: DynP ()
disableUnusedBinds = (WarningFlag -> DynP ()) -> [WarningFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ WarningFlag -> DynP ()
unSetWarningFlag [WarningFlag]
unusedBindsFlags
enableDLint :: DynP ()
enableDLint :: DynP ()
enableDLint = do
(GeneralFlag -> DynP ()) -> [GeneralFlag] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ GeneralFlag -> DynP ()
setGeneralFlag [GeneralFlag]
dLintFlags
Way -> DynP ()
addWayDynP Way
WayDebug
where
dLintFlags :: [GeneralFlag]
dLintFlags :: [GeneralFlag]
dLintFlags =
[ GeneralFlag
Opt_DoCoreLinting
, GeneralFlag
Opt_DoStgLinting
, GeneralFlag
Opt_DoCmmLinting
, GeneralFlag
Opt_DoAsmLinting
, GeneralFlag
Opt_CatchNonexhaustiveCases
, GeneralFlag
Opt_LlvmFillUndefWithGarbage
]
enableGlasgowExts :: DynP ()
enableGlasgowExts :: DynP ()
enableGlasgowExts = do GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PrintExplicitForalls
(Extension -> DynP ()) -> [Extension] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Extension -> DynP ()
setExtensionFlag [Extension]
glasgowExtsFlags
disableGlasgowExts :: DynP ()
disableGlasgowExts :: DynP ()
disableGlasgowExts = do GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_PrintExplicitForalls
(Extension -> DynP ()) -> [Extension] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Extension -> DynP ()
unSetExtensionFlag [Extension]
glasgowExtsFlags
glasgowExtsFlags :: [LangExt.Extension]
glasgowExtsFlags :: [Extension]
glasgowExtsFlags = [
Extension
LangExt.ConstrainedClassMethods
, Extension
LangExt.DeriveDataTypeable
, Extension
LangExt.DeriveFoldable
, Extension
LangExt.DeriveFunctor
, Extension
LangExt.DeriveGeneric
, Extension
LangExt.DeriveTraversable
, Extension
LangExt.EmptyDataDecls
, Extension
LangExt.ExistentialQuantification
, Extension
LangExt.ExplicitNamespaces
, Extension
LangExt.FlexibleContexts
, Extension
LangExt.FlexibleInstances
, Extension
LangExt.ForeignFunctionInterface
, Extension
LangExt.FunctionalDependencies
, Extension
LangExt.GeneralizedNewtypeDeriving
, Extension
LangExt.ImplicitParams
, Extension
LangExt.KindSignatures
, Extension
LangExt.LiberalTypeSynonyms
, Extension
LangExt.MagicHash
, Extension
LangExt.MultiParamTypeClasses
, Extension
LangExt.ParallelListComp
, Extension
LangExt.PatternGuards
, Extension
LangExt.PostfixOperators
, Extension
LangExt.RankNTypes
, Extension
LangExt.RecursiveDo
, Extension
LangExt.ScopedTypeVariables
, Extension
LangExt.StandaloneDeriving
, Extension
LangExt.TypeOperators
, Extension
LangExt.TypeSynonymInstances
, Extension
LangExt.UnboxedTuples
, Extension
LangExt.UnicodeSyntax
, Extension
LangExt.UnliftedFFITypes ]
setWarnSafe :: Bool -> DynP ()
setWarnSafe :: Bool -> DynP ()
setWarnSafe Bool
True = EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc EwM (CmdLineP DynFlags) SrcSpan -> (SrcSpan -> DynP ()) -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { warnSafeOnLoc :: SrcSpan
warnSafeOnLoc = SrcSpan
l })
setWarnSafe Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setWarnUnsafe :: Bool -> DynP ()
setWarnUnsafe :: Bool -> DynP ()
setWarnUnsafe Bool
True = EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc EwM (CmdLineP DynFlags) SrcSpan -> (SrcSpan -> DynP ()) -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { warnUnsafeOnLoc :: SrcSpan
warnUnsafeOnLoc = SrcSpan
l })
setWarnUnsafe Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setPackageTrust :: DynP ()
setPackageTrust :: DynP ()
setPackageTrust = do
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_PackageTrust
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
(DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> DynFlags
d { pkgTrustOnLoc :: SrcSpan
pkgTrustOnLoc = SrcSpan
l }
setGenDeriving :: TurnOnFlag -> DynP ()
setGenDeriving :: Bool -> DynP ()
setGenDeriving Bool
True = EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc EwM (CmdLineP DynFlags) SrcSpan -> (SrcSpan -> DynP ()) -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { newDerivOnLoc :: SrcSpan
newDerivOnLoc = SrcSpan
l })
setGenDeriving Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setDeriveVia :: TurnOnFlag -> DynP ()
setDeriveVia :: Bool -> DynP ()
setDeriveVia Bool
True = EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc EwM (CmdLineP DynFlags) SrcSpan -> (SrcSpan -> DynP ()) -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { deriveViaOnLoc :: SrcSpan
deriveViaOnLoc = SrcSpan
l })
setDeriveVia Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setOverlappingInsts :: TurnOnFlag -> DynP ()
setOverlappingInsts :: Bool -> DynP ()
setOverlappingInsts Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setOverlappingInsts Bool
True = do
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { overlapInstLoc :: SrcSpan
overlapInstLoc = SrcSpan
l })
setIncoherentInsts :: TurnOnFlag -> DynP ()
setIncoherentInsts :: Bool -> DynP ()
setIncoherentInsts Bool
False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setIncoherentInsts Bool
True = do
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { incoherentOnLoc :: SrcSpan
incoherentOnLoc = SrcSpan
l })
checkTemplateHaskellOk :: TurnOnFlag -> DynP ()
checkTemplateHaskellOk :: Bool -> DynP ()
checkTemplateHaskellOk Bool
_turn_on
= EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc EwM (CmdLineP DynFlags) SrcSpan -> (SrcSpan -> DynP ()) -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
d -> DynFlags
d { thOnLoc :: SrcSpan
thOnLoc = SrcSpan
l })
type DynP = EwM (CmdLineP DynFlags)
upd :: (DynFlags -> DynFlags) -> DynP ()
upd :: (DynFlags -> DynFlags) -> DynP ()
upd DynFlags -> DynFlags
f = CmdLineP DynFlags () -> DynP ()
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM (do DynFlags
dflags <- CmdLineP DynFlags DynFlags
forall s. CmdLineP s s
getCmdLineState
DynFlags -> CmdLineP DynFlags ()
forall s. s -> CmdLineP s ()
putCmdLineState (DynFlags -> CmdLineP DynFlags ())
-> DynFlags -> CmdLineP DynFlags ()
forall a b. (a -> b) -> a -> b
$! DynFlags -> DynFlags
f DynFlags
dflags)
updM :: (DynFlags -> DynP DynFlags) -> DynP ()
updM :: (DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
f = do DynFlags
dflags <- CmdLineP DynFlags DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM CmdLineP DynFlags DynFlags
forall s. CmdLineP s s
getCmdLineState
DynFlags
dflags' <- DynFlags -> DynP DynFlags
f DynFlags
dflags
CmdLineP DynFlags () -> DynP ()
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM (CmdLineP DynFlags () -> DynP ())
-> CmdLineP DynFlags () -> DynP ()
forall a b. (a -> b) -> a -> b
$ DynFlags -> CmdLineP DynFlags ()
forall s. s -> CmdLineP s ()
putCmdLineState (DynFlags -> CmdLineP DynFlags ())
-> DynFlags -> CmdLineP DynFlags ()
forall a b. (a -> b) -> a -> b
$! DynFlags
dflags'
noArg :: (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg :: (DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg DynFlags -> DynFlags
fn = DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd DynFlags -> DynFlags
fn)
noArgM :: (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM :: (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM DynFlags -> DynP DynFlags
fn = DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
fn)
hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg String -> DynFlags -> DynFlags
fn = (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg ((DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (String -> DynFlags -> DynFlags) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
fn)
sepArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg String -> DynFlags -> DynFlags
fn = (String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
SepArg ((DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (String -> DynFlags -> DynFlags) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> DynFlags -> DynFlags
fn)
intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix Int -> DynFlags -> DynFlags
fn = (Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Int -> EwM m ()) -> OptKind m
IntSuffix (\Int
n -> (DynFlags -> DynFlags) -> DynP ()
upd (Int -> DynFlags -> DynFlags
fn Int
n))
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM Int -> DynFlags -> DynP DynFlags
fn = (Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Int -> EwM m ()) -> OptKind m
IntSuffix (\Int
n -> (DynFlags -> DynP DynFlags) -> DynP ()
updM (Int -> DynFlags -> DynP DynFlags
fn Int
n))
wordSuffix :: (Word -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
wordSuffix :: (Word -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
wordSuffix Word -> DynFlags -> DynFlags
fn = (Word -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Word -> EwM m ()) -> OptKind m
WordSuffix (\Word
n -> (DynFlags -> DynFlags) -> DynP ()
upd (Word -> DynFlags -> DynFlags
fn Word
n))
floatSuffix :: (Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix :: (Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix Float -> DynFlags -> DynFlags
fn = (Float -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Float -> EwM m ()) -> OptKind m
FloatSuffix (\Float
n -> (DynFlags -> DynFlags) -> DynP ()
upd (Float -> DynFlags -> DynFlags
fn Float
n))
optIntSuffixM :: (Maybe Int -> DynFlags -> DynP DynFlags)
-> OptKind (CmdLineP DynFlags)
optIntSuffixM :: (Maybe Int -> DynFlags -> DynP DynFlags)
-> OptKind (CmdLineP DynFlags)
optIntSuffixM Maybe Int -> DynFlags -> DynP DynFlags
fn = (Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix (\Maybe Int
mi -> (DynFlags -> DynP DynFlags) -> DynP ()
updM (Maybe Int -> DynFlags -> DynP DynFlags
fn Maybe Int
mi))
setDumpFlag :: DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag :: DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
dump_flag = DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DumpFlag -> DynP ()
setDumpFlag' DumpFlag
dump_flag)
addWayDynP :: Way -> DynP ()
addWayDynP :: Way -> DynP ()
addWayDynP = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (Way -> DynFlags -> DynFlags) -> Way -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Way -> DynFlags -> DynFlags
addWay'
addWay' :: Way -> DynFlags -> DynFlags
addWay' :: Way -> DynFlags -> DynFlags
addWay' Way
w DynFlags
dflags0 =
let platform :: Platform
platform = DynFlags -> Platform
targetPlatform DynFlags
dflags0
dflags1 :: DynFlags
dflags1 = DynFlags
dflags0 { targetWays_ :: Ways
targetWays_ = Way -> Ways -> Ways
addWay Way
w (DynFlags -> Ways
targetWays_ DynFlags
dflags0) }
dflags2 :: DynFlags
dflags2 = (GeneralFlag -> DynFlags -> DynFlags)
-> DynFlags -> [GeneralFlag] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' DynFlags
dflags1
(Platform -> Way -> [GeneralFlag]
wayGeneralFlags Platform
platform Way
w)
dflags3 :: DynFlags
dflags3 = (GeneralFlag -> DynFlags -> DynFlags)
-> DynFlags -> [GeneralFlag] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' DynFlags
dflags2
(Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags Platform
platform Way
w)
in DynFlags
dflags3
removeWayDyn :: DynP ()
removeWayDyn :: DynP ()
removeWayDyn = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags
dfs { targetWays_ :: Ways
targetWays_ = Way -> Ways -> Ways
removeWay Way
WayDyn (DynFlags -> Ways
targetWays_ DynFlags
dfs) })
setGeneralFlag, unSetGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
f)
unSetGeneralFlag :: GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' GeneralFlag
f)
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
f DynFlags
dflags = ((DynFlags -> DynFlags) -> DynFlags -> DynFlags)
-> DynFlags -> [DynFlags -> DynFlags] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
($) (DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dflags GeneralFlag
f) [DynFlags -> DynFlags]
deps
where
deps :: [DynFlags -> DynFlags]
deps = [ if Bool
turn_on then GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
d
else GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' GeneralFlag
d
| (GeneralFlag
f', Bool
turn_on, GeneralFlag
d) <- [(GeneralFlag, Bool, GeneralFlag)]
impliedGFlags, GeneralFlag
f' GeneralFlag -> GeneralFlag -> Bool
forall a. Eq a => a -> a -> Bool
== GeneralFlag
f ]
unSetGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' GeneralFlag
f DynFlags
dflags = ((DynFlags -> DynFlags) -> DynFlags -> DynFlags)
-> DynFlags -> [DynFlags -> DynFlags] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
($) (DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
f) [DynFlags -> DynFlags]
deps
where
deps :: [DynFlags -> DynFlags]
deps = [ if Bool
turn_on then GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
d
else GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' GeneralFlag
d
| (GeneralFlag
f', Bool
turn_on, GeneralFlag
d) <- [(GeneralFlag, Bool, GeneralFlag)]
impliedOffGFlags, GeneralFlag
f' GeneralFlag -> GeneralFlag -> Bool
forall a. Eq a => a -> a -> Bool
== GeneralFlag
f ]
setWarningFlag, unSetWarningFlag :: WarningFlag -> DynP ()
setWarningFlag :: WarningFlag -> DynP ()
setWarningFlag WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_set DynFlags
dfs WarningFlag
f)
unSetWarningFlag :: WarningFlag -> DynP ()
unSetWarningFlag WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_unset DynFlags
dfs WarningFlag
f)
setFatalWarningFlag, unSetFatalWarningFlag :: WarningFlag -> DynP ()
setFatalWarningFlag :: WarningFlag -> DynP ()
setFatalWarningFlag WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_set_fatal DynFlags
dfs WarningFlag
f)
unSetFatalWarningFlag :: WarningFlag -> DynP ()
unSetFatalWarningFlag WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_unset_fatal DynFlags
dfs WarningFlag
f)
setWErrorFlag :: WarningFlag -> DynP ()
setWErrorFlag :: WarningFlag -> DynP ()
setWErrorFlag WarningFlag
flag =
do { WarningFlag -> DynP ()
setWarningFlag WarningFlag
flag
; WarningFlag -> DynP ()
setFatalWarningFlag WarningFlag
flag }
setExtensionFlag, unSetExtensionFlag :: LangExt.Extension -> DynP ()
setExtensionFlag :: Extension -> DynP ()
setExtensionFlag Extension
f = (DynFlags -> DynFlags) -> DynP ()
upd (Extension -> DynFlags -> DynFlags
setExtensionFlag' Extension
f)
unSetExtensionFlag :: Extension -> DynP ()
unSetExtensionFlag Extension
f = (DynFlags -> DynFlags) -> DynP ()
upd (Extension -> DynFlags -> DynFlags
unSetExtensionFlag' Extension
f)
setExtensionFlag', unSetExtensionFlag' :: LangExt.Extension -> DynFlags -> DynFlags
setExtensionFlag' :: Extension -> DynFlags -> DynFlags
setExtensionFlag' Extension
f DynFlags
dflags = ((DynFlags -> DynFlags) -> DynFlags -> DynFlags)
-> DynFlags -> [DynFlags -> DynFlags] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
($) (DynFlags -> Extension -> DynFlags
xopt_set DynFlags
dflags Extension
f) [DynFlags -> DynFlags]
deps
where
deps :: [DynFlags -> DynFlags]
deps = [ if Bool
turn_on then Extension -> DynFlags -> DynFlags
setExtensionFlag' Extension
d
else Extension -> DynFlags -> DynFlags
unSetExtensionFlag' Extension
d
| (Extension
f', Bool
turn_on, Extension
d) <- [(Extension, Bool, Extension)]
impliedXFlags, Extension
f' Extension -> Extension -> Bool
forall a. Eq a => a -> a -> Bool
== Extension
f ]
unSetExtensionFlag' :: Extension -> DynFlags -> DynFlags
unSetExtensionFlag' Extension
f DynFlags
dflags = DynFlags -> Extension -> DynFlags
xopt_unset DynFlags
dflags Extension
f
alterToolSettings :: (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings :: (ToolSettings -> ToolSettings) -> DynFlags -> DynFlags
alterToolSettings ToolSettings -> ToolSettings
f DynFlags
dynFlags = DynFlags
dynFlags { toolSettings :: ToolSettings
toolSettings = ToolSettings -> ToolSettings
f (DynFlags -> ToolSettings
toolSettings DynFlags
dynFlags) }
setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' DumpFlag
dump_flag
= do (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> DumpFlag -> DynFlags
dopt_set DynFlags
dfs DumpFlag
dump_flag)
Bool -> DynP () -> DynP ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
want_recomp DynP ()
forceRecompile
where
want_recomp :: Bool
want_recomp = DumpFlag
dump_flag DumpFlag -> [DumpFlag] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [DumpFlag
Opt_D_dump_if_trace,
DumpFlag
Opt_D_dump_hi_diffs,
DumpFlag
Opt_D_no_debug_output]
forceRecompile :: DynP ()
forceRecompile :: DynP ()
forceRecompile = do DynFlags
dfs <- CmdLineP DynFlags DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => m a -> EwM m a
liftEwM CmdLineP DynFlags DynFlags
forall s. CmdLineP s s
getCmdLineState
Bool -> DynP () -> DynP ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (DynFlags -> Bool
force_recomp DynFlags
dfs) (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_ForceRecomp)
where
force_recomp :: DynFlags -> Bool
force_recomp DynFlags
dfs = GhcMode -> Bool
isOneShot (DynFlags -> GhcMode
ghcMode DynFlags
dfs)
setVerbosity :: Maybe Int -> DynP ()
setVerbosity :: Maybe Int -> DynP ()
setVerbosity Maybe Int
mb_n = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags
dfs{ verbosity :: Int
verbosity = Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` Int
3 })
setDebugLevel :: Maybe Int -> DynP ()
setDebugLevel :: Maybe Int -> DynP ()
setDebugLevel Maybe Int
mb_n =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
dfs -> DynFlags -> DynFlags
exposeSyms (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dfs{ debugLevel :: Int
debugLevel = Int
n })
where
n :: Int
n = Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` Int
2
exposeSyms :: DynFlags -> DynFlags
exposeSyms
| Int
n Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
2 = GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
Opt_ExposeInternalSymbols
| Bool
otherwise = DynFlags -> DynFlags
forall a. a -> a
id
data PkgDbRef
= GlobalPkgDb
| UserPkgDb
| PkgDbPath FilePath
deriving PkgDbRef -> PkgDbRef -> Bool
(PkgDbRef -> PkgDbRef -> Bool)
-> (PkgDbRef -> PkgDbRef -> Bool) -> Eq PkgDbRef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PkgDbRef -> PkgDbRef -> Bool
$c/= :: PkgDbRef -> PkgDbRef -> Bool
== :: PkgDbRef -> PkgDbRef -> Bool
$c== :: PkgDbRef -> PkgDbRef -> Bool
Eq
addPkgDbRef :: PkgDbRef -> DynP ()
addPkgDbRef :: PkgDbRef -> DynP ()
addPkgDbRef PkgDbRef
p = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PkgDbRef -> PackageDBFlag
PackageDB PkgDbRef
p PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
removeUserPkgDb :: DynP ()
removeUserPkgDb :: DynP ()
removeUserPkgDb = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PackageDBFlag
NoUserPackageDB PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
removeGlobalPkgDb :: DynP ()
removeGlobalPkgDb :: DynP ()
removeGlobalPkgDb = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PackageDBFlag
NoGlobalPackageDB PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
clearPkgDb :: DynP ()
clearPkgDb :: DynP ()
clearPkgDb = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PackageDBFlag
ClearPackageDBs PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
parsePackageFlag :: String
-> ReadP PackageArg
-> String
-> PackageFlag
parsePackageFlag :: String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag String
flag ReadP PackageArg
arg_parse String
str
= case ((PackageFlag, String) -> Bool)
-> [(PackageFlag, String)] -> [(PackageFlag, String)]
forall a. (a -> Bool) -> [a] -> [a]
filter ((String -> String -> Bool
forall a. Eq a => a -> a -> Bool
==String
"")(String -> Bool)
-> ((PackageFlag, String) -> String)
-> (PackageFlag, String)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(PackageFlag, String) -> String
forall a b. (a, b) -> b
snd) (ReadP PackageFlag -> ReadS PackageFlag
forall a. ReadP a -> ReadS a
readP_to_S ReadP PackageFlag
parse String
str) of
[(PackageFlag
r, String
"")] -> PackageFlag
r
[(PackageFlag, String)]
_ -> GhcException -> PackageFlag
forall a. GhcException -> a
throwGhcException (GhcException -> PackageFlag) -> GhcException -> PackageFlag
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError (String
"Can't parse package flag: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str)
where doc :: String
doc = String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str
parse :: ReadP PackageFlag
parse = do
PackageArg
pkg_arg <- ReadP PackageArg -> ReadP PackageArg
forall b. ReadP b -> ReadP b
tok ReadP PackageArg
arg_parse
let mk_expose :: ModRenaming -> PackageFlag
mk_expose = String -> PackageArg -> ModRenaming -> PackageFlag
ExposePackage String
doc PackageArg
pkg_arg
( do String
_ <- ReadP String -> ReadP String
forall b. ReadP b -> ReadP b
tok (ReadP String -> ReadP String) -> ReadP String -> ReadP String
forall a b. (a -> b) -> a -> b
$ String -> ReadP String
string String
"with"
([(ModuleName, ModuleName)] -> PackageFlag)
-> ReadP [(ModuleName, ModuleName)] -> ReadP PackageFlag
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ModRenaming -> PackageFlag
mk_expose (ModRenaming -> PackageFlag)
-> ([(ModuleName, ModuleName)] -> ModRenaming)
-> [(ModuleName, ModuleName)]
-> PackageFlag
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> [(ModuleName, ModuleName)] -> ModRenaming
ModRenaming Bool
True) ReadP [(ModuleName, ModuleName)]
parseRns
ReadP PackageFlag -> ReadP PackageFlag -> ReadP PackageFlag
forall a. ReadP a -> ReadP a -> ReadP a
<++ ([(ModuleName, ModuleName)] -> PackageFlag)
-> ReadP [(ModuleName, ModuleName)] -> ReadP PackageFlag
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ModRenaming -> PackageFlag
mk_expose (ModRenaming -> PackageFlag)
-> ([(ModuleName, ModuleName)] -> ModRenaming)
-> [(ModuleName, ModuleName)]
-> PackageFlag
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> [(ModuleName, ModuleName)] -> ModRenaming
ModRenaming Bool
False) ReadP [(ModuleName, ModuleName)]
parseRns
ReadP PackageFlag -> ReadP PackageFlag -> ReadP PackageFlag
forall a. ReadP a -> ReadP a -> ReadP a
<++ PackageFlag -> ReadP PackageFlag
forall (m :: * -> *) a. Monad m => a -> m a
return (ModRenaming -> PackageFlag
mk_expose (Bool -> [(ModuleName, ModuleName)] -> ModRenaming
ModRenaming Bool
True [])))
parseRns :: ReadP [(ModuleName, ModuleName)]
parseRns = do Char
_ <- ReadP Char -> ReadP Char
forall b. ReadP b -> ReadP b
tok (ReadP Char -> ReadP Char) -> ReadP Char -> ReadP Char
forall a b. (a -> b) -> a -> b
$ Char -> ReadP Char
R.char Char
'('
[(ModuleName, ModuleName)]
rns <- ReadP [(ModuleName, ModuleName)]
-> ReadP [(ModuleName, ModuleName)]
forall b. ReadP b -> ReadP b
tok (ReadP [(ModuleName, ModuleName)]
-> ReadP [(ModuleName, ModuleName)])
-> ReadP [(ModuleName, ModuleName)]
-> ReadP [(ModuleName, ModuleName)]
forall a b. (a -> b) -> a -> b
$ ReadP (ModuleName, ModuleName)
-> ReadP Char -> ReadP [(ModuleName, ModuleName)]
forall a sep. ReadP a -> ReadP sep -> ReadP [a]
sepBy ReadP (ModuleName, ModuleName)
parseItem (ReadP Char -> ReadP Char
forall b. ReadP b -> ReadP b
tok (ReadP Char -> ReadP Char) -> ReadP Char -> ReadP Char
forall a b. (a -> b) -> a -> b
$ Char -> ReadP Char
R.char Char
',')
Char
_ <- ReadP Char -> ReadP Char
forall b. ReadP b -> ReadP b
tok (ReadP Char -> ReadP Char) -> ReadP Char -> ReadP Char
forall a b. (a -> b) -> a -> b
$ Char -> ReadP Char
R.char Char
')'
[(ModuleName, ModuleName)] -> ReadP [(ModuleName, ModuleName)]
forall (m :: * -> *) a. Monad m => a -> m a
return [(ModuleName, ModuleName)]
rns
parseItem :: ReadP (ModuleName, ModuleName)
parseItem = do
ModuleName
orig <- ReadP ModuleName -> ReadP ModuleName
forall b. ReadP b -> ReadP b
tok (ReadP ModuleName -> ReadP ModuleName)
-> ReadP ModuleName -> ReadP ModuleName
forall a b. (a -> b) -> a -> b
$ ReadP ModuleName
parseModuleName
(do String
_ <- ReadP String -> ReadP String
forall b. ReadP b -> ReadP b
tok (ReadP String -> ReadP String) -> ReadP String -> ReadP String
forall a b. (a -> b) -> a -> b
$ String -> ReadP String
string String
"as"
ModuleName
new <- ReadP ModuleName -> ReadP ModuleName
forall b. ReadP b -> ReadP b
tok (ReadP ModuleName -> ReadP ModuleName)
-> ReadP ModuleName -> ReadP ModuleName
forall a b. (a -> b) -> a -> b
$ ReadP ModuleName
parseModuleName
(ModuleName, ModuleName) -> ReadP (ModuleName, ModuleName)
forall (m :: * -> *) a. Monad m => a -> m a
return (ModuleName
orig, ModuleName
new)
ReadP (ModuleName, ModuleName)
-> ReadP (ModuleName, ModuleName) -> ReadP (ModuleName, ModuleName)
forall a. ReadP a -> ReadP a -> ReadP a
+++
(ModuleName, ModuleName) -> ReadP (ModuleName, ModuleName)
forall (m :: * -> *) a. Monad m => a -> m a
return (ModuleName
orig, ModuleName
orig))
tok :: ReadP b -> ReadP b
tok ReadP b
m = ReadP b
m ReadP b -> (b -> ReadP b) -> ReadP b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \b
x -> ReadP ()
skipSpaces ReadP () -> ReadP b -> ReadP b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> b -> ReadP b
forall (m :: * -> *) a. Monad m => a -> m a
return b
x
exposePackage, exposePackageId, hidePackage,
exposePluginPackage, exposePluginPackageId,
ignorePackage,
trustPackage, distrustPackage :: String -> DynP ()
exposePackage :: String -> DynP ()
exposePackage String
p = (DynFlags -> DynFlags) -> DynP ()
upd (String -> DynFlags -> DynFlags
exposePackage' String
p)
exposePackageId :: String -> DynP ()
exposePackageId String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ packageFlags :: [PackageFlag]
packageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag String
"-package-id" ReadP PackageArg
parseUnitArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
packageFlags DynFlags
s })
exposePluginPackage :: String -> DynP ()
exposePluginPackage String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ pluginPackageFlags :: [PackageFlag]
pluginPackageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag String
"-plugin-package" ReadP PackageArg
parsePackageArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
s })
exposePluginPackageId :: String -> DynP ()
exposePluginPackageId String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ pluginPackageFlags :: [PackageFlag]
pluginPackageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag String
"-plugin-package-id" ReadP PackageArg
parseUnitArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
s })
hidePackage :: String -> DynP ()
hidePackage String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ packageFlags :: [PackageFlag]
packageFlags = String -> PackageFlag
HidePackage String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
packageFlags DynFlags
s })
ignorePackage :: String -> DynP ()
ignorePackage String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ ignorePackageFlags :: [IgnorePackageFlag]
ignorePackageFlags = String -> IgnorePackageFlag
IgnorePackage String
p IgnorePackageFlag -> [IgnorePackageFlag] -> [IgnorePackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [IgnorePackageFlag]
ignorePackageFlags DynFlags
s })
trustPackage :: String -> DynP ()
trustPackage String
p = String -> DynP ()
exposePackage String
p DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ trustFlags :: [TrustFlag]
trustFlags = String -> TrustFlag
TrustPackage String
p TrustFlag -> [TrustFlag] -> [TrustFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [TrustFlag]
trustFlags DynFlags
s })
distrustPackage :: String -> DynP ()
distrustPackage String
p = String -> DynP ()
exposePackage String
p DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ trustFlags :: [TrustFlag]
trustFlags = String -> TrustFlag
DistrustPackage String
p TrustFlag -> [TrustFlag] -> [TrustFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [TrustFlag]
trustFlags DynFlags
s })
exposePackage' :: String -> DynFlags -> DynFlags
exposePackage' :: String -> DynFlags -> DynFlags
exposePackage' String
p DynFlags
dflags
= DynFlags
dflags { packageFlags :: [PackageFlag]
packageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag String
"-package" ReadP PackageArg
parsePackageArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
packageFlags DynFlags
dflags }
parsePackageArg :: ReadP PackageArg
parsePackageArg :: ReadP PackageArg
parsePackageArg =
(String -> PackageArg) -> ReadP String -> ReadP PackageArg
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> PackageArg
PackageArg ((Char -> Bool) -> ReadP String
munch1 (\Char
c -> Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> String -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` String
":-_."))
parseUnitArg :: ReadP PackageArg
parseUnitArg :: ReadP PackageArg
parseUnitArg =
(Unit -> PackageArg) -> ReadP Unit -> ReadP PackageArg
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Unit -> PackageArg
UnitIdArg ReadP Unit
parseUnit
setUnitId :: String -> DynFlags -> DynFlags
setUnitId :: String -> DynFlags -> DynFlags
setUnitId String
p DynFlags
d = DynFlags
d { homeUnitId_ :: UnitId
homeUnitId_ = String -> UnitId
stringToUnitId String
p }
setWorkingDirectory :: String -> DynFlags -> DynFlags
setWorkingDirectory :: String -> DynFlags -> DynFlags
setWorkingDirectory String
p DynFlags
d = DynFlags
d { workingDirectory :: Maybe String
workingDirectory = String -> Maybe String
forall a. a -> Maybe a
Just String
p }
augmentByWorkingDirectory :: DynFlags -> FilePath -> FilePath
augmentByWorkingDirectory :: DynFlags -> ShowS
augmentByWorkingDirectory DynFlags
dflags String
fp | String -> Bool
isRelative String
fp, Just String
offset <- DynFlags -> Maybe String
workingDirectory DynFlags
dflags = String
offset String -> ShowS
</> String
fp
augmentByWorkingDirectory DynFlags
_ String
fp = String
fp
setPackageName :: String -> DynFlags -> DynFlags
setPackageName :: String -> DynFlags -> DynFlags
setPackageName String
p DynFlags
d = DynFlags
d { thisPackageName :: Maybe String
thisPackageName = String -> Maybe String
forall a. a -> Maybe a
Just String
p }
addHiddenModule :: String -> DynP ()
addHiddenModule :: String -> DynP ()
addHiddenModule String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ hiddenModules :: Set ModuleName
hiddenModules = ModuleName -> Set ModuleName -> Set ModuleName
forall a. Ord a => a -> Set a -> Set a
Set.insert (String -> ModuleName
mkModuleName String
p) (DynFlags -> Set ModuleName
hiddenModules DynFlags
s) })
addReexportedModule :: String -> DynP ()
addReexportedModule :: String -> DynP ()
addReexportedModule String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{ reexportedModules :: Set ModuleName
reexportedModules = ModuleName -> Set ModuleName -> Set ModuleName
forall a. Ord a => a -> Set a -> Set a
Set.insert (String -> ModuleName
mkModuleName String
p) (DynFlags -> Set ModuleName
reexportedModules DynFlags
s) })
setBackend :: Backend -> DynP ()
setBackend :: Backend -> DynP ()
setBackend Backend
l = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ DynFlags
dfs ->
if DynFlags -> GhcLink
ghcLink DynFlags
dfs GhcLink -> GhcLink -> Bool
forall a. Eq a => a -> a -> Bool
/= GhcLink
LinkBinary Bool -> Bool -> Bool
|| Backend -> Bool
backendProducesObject Backend
l
then DynFlags
dfs{ backend :: Backend
backend = Backend
l }
else DynFlags
dfs
setObjBackend :: Backend -> DynP ()
setObjBackend :: Backend -> DynP ()
setObjBackend Backend
l = (DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
set
where
set :: DynFlags -> DynP DynFlags
set DynFlags
dflags
| Backend -> Bool
backendProducesObject (DynFlags -> Backend
backend DynFlags
dflags)
= DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> DynP DynFlags) -> DynFlags -> DynP DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dflags { backend :: Backend
backend = Backend
l }
| Bool
otherwise = DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags
setOptLevel :: Int -> DynFlags -> DynP DynFlags
setOptLevel :: Int -> DynFlags -> DynP DynFlags
setOptLevel Int
n DynFlags
dflags = DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (Int -> DynFlags -> DynFlags
updOptLevel Int
n DynFlags
dflags)
setCallerCcFilters :: String -> DynP ()
setCallerCcFilters :: String -> DynP ()
setCallerCcFilters String
arg =
case String -> Either String CallerCcFilter
parseCallerCcFilter String
arg of
Right CallerCcFilter
filt -> (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> DynFlags
d { callerCcFilters :: [CallerCcFilter]
callerCcFilters = CallerCcFilter
filt CallerCcFilter -> [CallerCcFilter] -> [CallerCcFilter]
forall a. a -> [a] -> [a]
: DynFlags -> [CallerCcFilter]
callerCcFilters DynFlags
d }
Left String
err -> String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addErr String
err
setMainIs :: String -> DynP ()
setMainIs :: String -> DynP ()
setMainIs String
arg
| Bool -> Bool
not (String -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null String
main_fn) Bool -> Bool -> Bool
&& Char -> Bool
isLower (String -> Char
forall a. [a] -> a
head String
main_fn)
= (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> DynFlags
d { mainFunIs :: Maybe String
mainFunIs = String -> Maybe String
forall a. a -> Maybe a
Just String
main_fn,
mainModuleNameIs :: ModuleName
mainModuleNameIs = String -> ModuleName
mkModuleName String
main_mod }
| Char -> Bool
isUpper (String -> Char
forall a. [a] -> a
head String
arg)
= (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> DynFlags
d { mainModuleNameIs :: ModuleName
mainModuleNameIs = String -> ModuleName
mkModuleName String
arg }
| Bool
otherwise
= (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \DynFlags
d -> DynFlags
d { mainFunIs :: Maybe String
mainFunIs = String -> Maybe String
forall a. a -> Maybe a
Just String
arg }
where
(String
main_mod, String
main_fn) = String -> (Char -> Bool) -> (String, String)
splitLongestPrefix String
arg (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'.')
addLdInputs :: Option -> DynFlags -> DynFlags
addLdInputs :: Option -> DynFlags -> DynFlags
addLdInputs Option
p DynFlags
dflags = DynFlags
dflags{ldInputs :: [Option]
ldInputs = DynFlags -> [Option]
ldInputs DynFlags
dflags [Option] -> [Option] -> [Option]
forall a. [a] -> [a] -> [a]
++ [Option
p]}
setFlagsFromEnvFile :: FilePath -> String -> DynP ()
setFlagsFromEnvFile :: String -> String -> DynP ()
setFlagsFromEnvFile String
envfile String
content = do
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_HideAllPackages
String -> String -> DynP ()
parseEnvFile String
envfile String
content
parseEnvFile :: FilePath -> String -> DynP ()
parseEnvFile :: String -> String -> DynP ()
parseEnvFile String
envfile = (String -> DynP ()) -> [String] -> DynP ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ String -> DynP ()
parseEntry ([String] -> DynP ()) -> (String -> [String]) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [String]
lines
where
parseEntry :: String -> DynP ()
parseEntry String
str = case String -> [String]
words String
str of
(String
"package-db": [String]
_) -> PkgDbRef -> DynP ()
addPkgDbRef (String -> PkgDbRef
PkgDbPath (String
envdir String -> ShowS
</> String
db))
where envdir :: String
envdir = ShowS
takeDirectory String
envfile
db :: String
db = Int -> ShowS
forall a. Int -> [a] -> [a]
drop Int
11 String
str
[String
"clear-package-db"] -> DynP ()
clearPkgDb
[String
"hide-package", String
pkg] -> String -> DynP ()
hidePackage String
pkg
[String
"global-package-db"] -> PkgDbRef -> DynP ()
addPkgDbRef PkgDbRef
GlobalPkgDb
[String
"user-package-db"] -> PkgDbRef -> DynP ()
addPkgDbRef PkgDbRef
UserPkgDb
[String
"package-id", String
pkgid] -> String -> DynP ()
exposePackageId String
pkgid
((Char
'-':Char
'-':String
_):[String]
_) -> () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
[String
pkgid] -> String -> DynP ()
exposePackageId String
pkgid
[] -> () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
[String]
_ -> GhcException -> DynP ()
forall a. GhcException -> a
throwGhcException (GhcException -> DynP ()) -> GhcException -> DynP ()
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError (String -> GhcException) -> String -> GhcException
forall a b. (a -> b) -> a -> b
$
String
"Can't parse environment file entry: "
String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
envfile String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
": " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str
addImportPath, addLibraryPath, addIncludePath, addFrameworkPath :: FilePath -> DynP ()
addImportPath :: String -> DynP ()
addImportPath String
"" = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{importPaths :: [String]
importPaths = []})
addImportPath String
p = (DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{importPaths :: [String]
importPaths = DynFlags -> [String]
importPaths DynFlags
s [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ String -> [String]
splitPathList String
p})
addLibraryPath :: String -> DynP ()
addLibraryPath String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{libraryPaths :: [String]
libraryPaths = DynFlags -> [String]
libraryPaths DynFlags
s [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ String -> [String]
splitPathList String
p})
addIncludePath :: String -> DynP ()
addIncludePath String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{includePaths :: IncludeSpecs
includePaths =
IncludeSpecs -> [String] -> IncludeSpecs
addGlobalInclude (DynFlags -> IncludeSpecs
includePaths DynFlags
s) (String -> [String]
splitPathList String
p)})
addFrameworkPath :: String -> DynP ()
addFrameworkPath String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\DynFlags
s -> DynFlags
s{frameworkPaths :: [String]
frameworkPaths = DynFlags -> [String]
frameworkPaths DynFlags
s [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ String -> [String]
splitPathList String
p})
#if !defined(mingw32_HOST_OS)
split_marker :: Char
split_marker :: Char
split_marker = Char
':'
#endif
splitPathList :: String -> [String]
splitPathList :: String -> [String]
splitPathList String
s = (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter String -> Bool
forall (f :: * -> *) a. Foldable f => f a -> Bool
notNull (String -> [String]
splitUp String
s)
where
#if !defined(mingw32_HOST_OS)
splitUp :: String -> [String]
splitUp String
xs = Char -> String -> [String]
split Char
split_marker String
xs
#else
splitUp [] = []
splitUp (x:':':div:xs) | div `elem` dir_markers
= ((x:':':div:p): splitUp rs)
where
(p,rs) = findNextPath xs
splitUp xs = cons p (splitUp rs)
where
(p,rs) = findNextPath xs
cons "" xs = xs
cons x xs = x:xs
findNextPath xs =
case break (`elem` split_markers) xs of
(p, _:ds) -> (p, ds)
(p, xs) -> (p, xs)
split_markers :: [Char]
split_markers = [':', ';']
dir_markers :: [Char]
dir_markers = ['/', '\\']
#endif
setTmpDir :: FilePath -> DynFlags -> DynFlags
setTmpDir :: String -> DynFlags -> DynFlags
setTmpDir String
dir DynFlags
d = DynFlags
d { tmpDir :: TempDir
tmpDir = String -> TempDir
TempDir (ShowS
normalise String
dir) }
setRtsOpts :: String -> DynP ()
setRtsOpts :: String -> DynP ()
setRtsOpts String
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ DynFlags
d -> DynFlags
d {rtsOpts :: Maybe String
rtsOpts = String -> Maybe String
forall a. a -> Maybe a
Just String
arg}
setRtsOptsEnabled :: RtsOptsEnabled -> DynP ()
setRtsOptsEnabled :: RtsOptsEnabled -> DynP ()
setRtsOptsEnabled RtsOptsEnabled
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ DynFlags
d -> DynFlags
d {rtsOptsEnabled :: RtsOptsEnabled
rtsOptsEnabled = RtsOptsEnabled
arg}
setOptHpcDir :: String -> DynP ()
setOptHpcDir :: String -> DynP ()
setOptHpcDir String
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ DynFlags
d -> DynFlags
d {hpcDir :: String
hpcDir = String
arg}
picCCOpts :: DynFlags -> [String]
picCCOpts :: DynFlags -> [String]
picCCOpts DynFlags
dflags =
case Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
OS
OSDarwin
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags -> [String
"-fno-common", String
"-U__PIC__", String
"-D__PIC__"]
| Bool
otherwise -> [String
"-mdynamic-no-pic"]
OS
OSMinGW32
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags -> [String
"-U__PIC__", String
"-D__PIC__"]
| Bool
otherwise -> []
OS
_
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Ways
ways DynFlags
dflags Ways -> Way -> Bool
`hasWay` Way
WayDyn ->
[String
"-fPIC", String
"-U__PIC__", String
"-D__PIC__"]
| Bool
otherwise -> [String
"-fno-PIC"]
pieCCLDOpts :: DynFlags -> [String]
pieCCLDOpts :: DynFlags -> [String]
pieCCLDOpts DynFlags
dflags
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PICExecutable DynFlags
dflags = [String
"-pie"]
| ToolSettings -> Bool
toolSettings_ccSupportsNoPie (DynFlags -> ToolSettings
toolSettings DynFlags
dflags) = [String
"-no-pie"]
| Bool
otherwise = []
picPOpts :: DynFlags -> [String]
picPOpts :: DynFlags -> [String]
picPOpts DynFlags
dflags
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags = [String
"-U__PIC__", String
"-D__PIC__"]
| Bool
otherwise = []
compilerInfo :: DynFlags -> [(String, String)]
compilerInfo :: DynFlags -> [(String, String)]
compilerInfo DynFlags
dflags
=
(String
"Project name", String
cProjectName)
(String, String) -> [(String, String)] -> [(String, String)]
forall a. a -> [a] -> [a]
: ((String, String) -> (String, String))
-> [(String, String)] -> [(String, String)]
forall a b. (a -> b) -> [a] -> [b]
map (ShowS -> (String, String) -> (String, String)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ShowS -> (String, String) -> (String, String))
-> ShowS -> (String, String) -> (String, String)
forall a b. (a -> b) -> a -> b
$ String -> Maybe String -> ShowS
expandDirectories (DynFlags -> String
topDir DynFlags
dflags) (DynFlags -> Maybe String
toolDir DynFlags
dflags))
(DynFlags -> [(String, String)]
rawSettings DynFlags
dflags)
[(String, String)] -> [(String, String)] -> [(String, String)]
forall a. [a] -> [a] -> [a]
++ [(String
"Project version", DynFlags -> String
projectVersion DynFlags
dflags),
(String
"Project Git commit id", String
cProjectGitCommitId),
(String
"Project Version Int", String
cProjectVersionInt),
(String
"Project Patch Level", String
cProjectPatchLevel),
(String
"Project Patch Level1", String
cProjectPatchLevel1),
(String
"Project Patch Level2", String
cProjectPatchLevel2),
(String
"Booter version", String
cBooterVersion),
(String
"Stage", String
cStage),
(String
"Build platform", String
cBuildPlatformString),
(String
"Host platform", String
cHostPlatformString),
(String
"Target platform", PlatformMisc -> String
platformMisc_targetPlatformString (PlatformMisc -> String) -> PlatformMisc -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> PlatformMisc
platformMisc DynFlags
dflags),
(String
"Have interpreter", Bool -> String
showBool (Bool -> String) -> Bool -> String
forall a b. (a -> b) -> a -> b
$ PlatformMisc -> Bool
platformMisc_ghcWithInterpreter (PlatformMisc -> Bool) -> PlatformMisc -> Bool
forall a b. (a -> b) -> a -> b
$ DynFlags -> PlatformMisc
platformMisc DynFlags
dflags),
(String
"Object splitting supported", Bool -> String
showBool Bool
False),
(String
"Have native code generator", Bool -> String
showBool (Bool -> String) -> Bool -> String
forall a b. (a -> b) -> a -> b
$ Platform -> Bool
platformNcgSupported (DynFlags -> Platform
targetPlatform DynFlags
dflags)),
(String
"Target default backend", Backend -> String
forall a. Show a => a -> String
show (Backend -> String) -> Backend -> String
forall a b. (a -> b) -> a -> b
$ Platform -> Backend
platformDefaultBackend (DynFlags -> Platform
targetPlatform DynFlags
dflags)),
(String
"Support dynamic-too", Bool -> String
showBool (Bool -> String) -> Bool -> String
forall a b. (a -> b) -> a -> b
$ Bool -> Bool
not Bool
isWindows),
(String
"Support parallel --make", String
"YES"),
(String
"Support reexported-modules", String
"YES"),
(String
"Support thinning and renaming package flags", String
"YES"),
(String
"Support Backpack", String
"YES"),
(String
"Requires unified installed package IDs", String
"YES"),
(String
"Uses package keys", String
"YES"),
(String
"Uses unit IDs", String
"YES"),
(String
"GHC Dynamic", Bool -> String
showBool Bool
hostIsDynamic),
(String
"GHC Profiled", Bool -> String
showBool Bool
hostIsProfiled),
(String
"Debug on", Bool -> String
showBool Bool
debugIsOn),
(String
"LibDir", DynFlags -> String
topDir DynFlags
dflags),
(String
"Global Package DB", DynFlags -> String
globalPackageDatabasePath DynFlags
dflags)
]
where
showBool :: Bool -> String
showBool Bool
True = String
"YES"
showBool Bool
False = String
"NO"
platform :: Platform
platform = DynFlags -> Platform
targetPlatform DynFlags
dflags
isWindows :: Bool
isWindows = Platform -> OS
platformOS Platform
platform OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32
useInplaceMinGW :: Bool
useInplaceMinGW = ToolSettings -> Bool
toolSettings_useInplaceMinGW (ToolSettings -> Bool) -> ToolSettings -> Bool
forall a b. (a -> b) -> a -> b
$ DynFlags -> ToolSettings
toolSettings DynFlags
dflags
expandDirectories :: FilePath -> Maybe FilePath -> String -> String
expandDirectories :: String -> Maybe String -> ShowS
expandDirectories String
topd Maybe String
mtoold = Bool -> Maybe String -> ShowS
expandToolDir Bool
useInplaceMinGW Maybe String
mtoold ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
expandTopDir String
topd
targetProfile :: DynFlags -> Profile
targetProfile :: DynFlags -> Profile
targetProfile DynFlags
dflags = Platform -> Ways -> Profile
Profile (DynFlags -> Platform
targetPlatform DynFlags
dflags) (DynFlags -> Ways
ways DynFlags
dflags)
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent DynFlags
dflags
| OS
os OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32 Bool -> Bool -> Bool
&& GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_BuildDynamicToo DynFlags
dflags
= let dflags' :: DynFlags
dflags' = DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_BuildDynamicToo
warn :: String
warn = String
"-dynamic-too is not supported on Windows"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| DynFlags -> Ways
ways DynFlags
dflags Ways -> Way -> Bool
`hasWay` Way
WayDyn Bool -> Bool -> Bool
&& GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_BuildDynamicToo DynFlags
dflags
= let dflags' :: DynFlags
dflags' = DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_BuildDynamicToo
warn :: String
warn = String
"-dynamic-too is ignored when using -dynamic"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| DynFlags -> Backend
backend DynFlags
dflags Backend -> Backend -> Bool
forall a. Eq a => a -> a -> Bool
== Backend
ViaC Bool -> Bool -> Bool
&&
Bool -> Bool
not (Platform -> Bool
platformUnregisterised (DynFlags -> Platform
targetPlatform DynFlags
dflags))
= case Platform -> Backend
platformDefaultBackend (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
Backend
NCG -> let dflags' :: DynFlags
dflags' = DynFlags
dflags { backend :: Backend
backend = Backend
NCG }
warn :: String
warn = String
"Target platform doesn't use unregisterised ABI, so using native code generator rather than compiling via C"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
Backend
LLVM -> let dflags' :: DynFlags
dflags' = DynFlags
dflags { backend :: Backend
backend = Backend
LLVM }
warn :: String
warn = String
"Target platform doesn't use unregisterised ABI, so using LLVM rather than compiling via C"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
Backend
_ -> String -> (DynFlags, [Located String])
forall a. String -> a
pgmError String
"Compiling via C only supports unregisterised ABI but target platform doesn't use it."
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_Hpc DynFlags
dflags Bool -> Bool -> Bool
&& DynFlags -> Backend
backend DynFlags
dflags Backend -> Backend -> Bool
forall a. Eq a => a -> a -> Bool
== Backend
Interpreter
= let dflags' :: DynFlags
dflags' = DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_Hpc
warn :: String
warn = String
"Hpc can't be used with byte-code interpreter. Ignoring -fhpc."
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| DynFlags -> Backend
backend DynFlags
dflags Backend -> [Backend] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Backend
NCG, Backend
LLVM] Bool -> Bool -> Bool
&&
Platform -> Bool
platformUnregisterised (DynFlags -> Platform
targetPlatform DynFlags
dflags)
= DynFlags -> String -> (DynFlags, [Located String])
loop (DynFlags
dflags { backend :: Backend
backend = Backend
ViaC })
String
"Target platform uses unregisterised ABI, so compiling via C"
| DynFlags -> Backend
backend DynFlags
dflags Backend -> Backend -> Bool
forall a. Eq a => a -> a -> Bool
== Backend
NCG Bool -> Bool -> Bool
&&
Bool -> Bool
not (Platform -> Bool
platformNcgSupported (Platform -> Bool) -> Platform -> Bool
forall a b. (a -> b) -> a -> b
$ DynFlags -> Platform
targetPlatform DynFlags
dflags)
= let dflags' :: DynFlags
dflags' = DynFlags
dflags { backend :: Backend
backend = Backend
LLVM }
warn :: String
warn = String
"Native code generator doesn't support target platform, so using LLVM"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| Bool -> Bool
not (OS -> Bool
osElfTarget OS
os) Bool -> Bool -> Bool
&& GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIE DynFlags
dflags
= DynFlags -> String -> (DynFlags, [Located String])
loop (DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_PIE)
String
"Position-independent only supported on ELF platforms"
| OS
os OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSDarwin Bool -> Bool -> Bool
&&
Arch
arch Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== Arch
ArchX86_64 Bool -> Bool -> Bool
&&
Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags)
= DynFlags -> String -> (DynFlags, [Located String])
loop (DynFlags -> GeneralFlag -> DynFlags
gopt_set DynFlags
dflags GeneralFlag
Opt_PIC)
String
"Enabling -fPIC as it is always on for this platform"
| DynFlags -> Backend
backend DynFlags
dflags Backend -> Backend -> Bool
forall a. Eq a => a -> a -> Bool
== Backend
Interpreter
, let (DynFlags
dflags', Bool
changed) = Int -> DynFlags -> (DynFlags, Bool)
updOptLevelChanged Int
0 DynFlags
dflags
, Bool
changed
= DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
"Optimization flags conflict with --interactive; optimization flags ignored."
| GhcLink
LinkInMemory <- DynFlags -> GhcLink
ghcLink DynFlags
dflags
, Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalInterpreter DynFlags
dflags)
, Bool
hostIsProfiled
, Backend -> Bool
backendProducesObject (DynFlags -> Backend
backend DynFlags
dflags)
, DynFlags -> Ways
ways DynFlags
dflags Ways -> Way -> Bool
`hasNotWay` Way
WayProf
= DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags{targetWays_ :: Ways
targetWays_ = Way -> Ways -> Ways
addWay Way
WayProf (DynFlags -> Ways
targetWays_ DynFlags
dflags)}
String
"Enabling -prof, because -fobject-code is enabled and GHCi is profiled"
| GhcLink
LinkMergedObj <- DynFlags -> GhcLink
ghcLink DynFlags
dflags
, Maybe String
Nothing <- DynFlags -> Maybe String
outputFile DynFlags
dflags
= String -> (DynFlags, [Located String])
forall a. String -> a
pgmError String
"--output must be specified when using --merge-objs"
| Bool
otherwise = (DynFlags
dflags, [])
where loc :: SrcSpan
loc = FastString -> SrcSpan
mkGeneralSrcSpan (String -> FastString
fsLit String
"when making flags consistent")
loop :: DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
updated_dflags String
warning
= case DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent DynFlags
updated_dflags of
(DynFlags
dflags', [Located String]
ws) -> (DynFlags
dflags', SrcSpan -> String -> Located String
forall l e. l -> e -> GenLocated l e
L SrcSpan
loc String
warning Located String -> [Located String] -> [Located String]
forall a. a -> [a] -> [a]
: [Located String]
ws)
platform :: Platform
platform = DynFlags -> Platform
targetPlatform DynFlags
dflags
arch :: Arch
arch = Platform -> Arch
platformArch Platform
platform
os :: OS
os = Platform -> OS
platformOS Platform
platform
setUnsafeGlobalDynFlags :: DynFlags -> IO ()
setUnsafeGlobalDynFlags :: DynFlags -> IO ()
setUnsafeGlobalDynFlags DynFlags
dflags = do
IORef Bool -> Bool -> IO ()
forall a. IORef a -> a -> IO ()
writeIORef IORef Bool
v_unsafeHasPprDebug (DynFlags -> Bool
hasPprDebug DynFlags
dflags)
IORef Bool -> Bool -> IO ()
forall a. IORef a -> a -> IO ()
writeIORef IORef Bool
v_unsafeHasNoDebugOutput (DynFlags -> Bool
hasNoDebugOutput DynFlags
dflags)
IORef Bool -> Bool -> IO ()
forall a. IORef a -> a -> IO ()
writeIORef IORef Bool
v_unsafeHasNoStateHack (DynFlags -> Bool
hasNoStateHack DynFlags
dflags)
isSse4_2Enabled :: DynFlags -> Bool
isSse4_2Enabled :: DynFlags -> Bool
isSse4_2Enabled DynFlags
dflags = DynFlags -> Maybe SseVersion
sseVersion DynFlags
dflags Maybe SseVersion -> Maybe SseVersion -> Bool
forall a. Ord a => a -> a -> Bool
>= SseVersion -> Maybe SseVersion
forall a. a -> Maybe a
Just SseVersion
SSE42
isAvxEnabled :: DynFlags -> Bool
isAvxEnabled :: DynFlags -> Bool
isAvxEnabled DynFlags
dflags = DynFlags -> Bool
avx DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
avx2 DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
avx512f DynFlags
dflags
isAvx2Enabled :: DynFlags -> Bool
isAvx2Enabled :: DynFlags -> Bool
isAvx2Enabled DynFlags
dflags = DynFlags -> Bool
avx2 DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
avx512f DynFlags
dflags
isAvx512cdEnabled :: DynFlags -> Bool
isAvx512cdEnabled :: DynFlags -> Bool
isAvx512cdEnabled DynFlags
dflags = DynFlags -> Bool
avx512cd DynFlags
dflags
isAvx512erEnabled :: DynFlags -> Bool
isAvx512erEnabled :: DynFlags -> Bool
isAvx512erEnabled DynFlags
dflags = DynFlags -> Bool
avx512er DynFlags
dflags
isAvx512fEnabled :: DynFlags -> Bool
isAvx512fEnabled :: DynFlags -> Bool
isAvx512fEnabled DynFlags
dflags = DynFlags -> Bool
avx512f DynFlags
dflags
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512pfEnabled DynFlags
dflags = DynFlags -> Bool
avx512pf DynFlags
dflags
isBmiEnabled :: DynFlags -> Bool
isBmiEnabled :: DynFlags -> Bool
isBmiEnabled DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
Arch
ArchX86_64 -> DynFlags -> Maybe BmiVersion
bmiVersion DynFlags
dflags Maybe BmiVersion -> Maybe BmiVersion -> Bool
forall a. Ord a => a -> a -> Bool
>= BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI1
Arch
ArchX86 -> DynFlags -> Maybe BmiVersion
bmiVersion DynFlags
dflags Maybe BmiVersion -> Maybe BmiVersion -> Bool
forall a. Ord a => a -> a -> Bool
>= BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI1
Arch
_ -> Bool
False
isBmi2Enabled :: DynFlags -> Bool
isBmi2Enabled :: DynFlags -> Bool
isBmi2Enabled DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
Arch
ArchX86_64 -> DynFlags -> Maybe BmiVersion
bmiVersion DynFlags
dflags Maybe BmiVersion -> Maybe BmiVersion -> Bool
forall a. Ord a => a -> a -> Bool
>= BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI2
Arch
ArchX86 -> DynFlags -> Maybe BmiVersion
bmiVersion DynFlags
dflags Maybe BmiVersion -> Maybe BmiVersion -> Bool
forall a. Ord a => a -> a -> Bool
>= BmiVersion -> Maybe BmiVersion
forall a. a -> Maybe a
Just BmiVersion
BMI2
Arch
_ -> Bool
False
sccProfilingEnabled :: DynFlags -> Bool
sccProfilingEnabled :: DynFlags -> Bool
sccProfilingEnabled DynFlags
dflags = Profile -> Bool
profileIsProfiling (DynFlags -> Profile
targetProfile DynFlags
dflags)
needSourceNotes :: DynFlags -> Bool
needSourceNotes :: DynFlags -> Bool
needSourceNotes DynFlags
dflags = DynFlags -> Int
debugLevel DynFlags
dflags Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
0
Bool -> Bool -> Bool
|| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_InfoTableMap DynFlags
dflags
data LinkerInfo
= GnuLD [Option]
| GnuGold [Option]
| LlvmLLD [Option]
| DarwinLD [Option]
| SolarisLD [Option]
| AixLD [Option]
| UnknownLD
deriving LinkerInfo -> LinkerInfo -> Bool
(LinkerInfo -> LinkerInfo -> Bool)
-> (LinkerInfo -> LinkerInfo -> Bool) -> Eq LinkerInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LinkerInfo -> LinkerInfo -> Bool
$c/= :: LinkerInfo -> LinkerInfo -> Bool
== :: LinkerInfo -> LinkerInfo -> Bool
$c== :: LinkerInfo -> LinkerInfo -> Bool
Eq
data CompilerInfo
= GCC
| Clang
| AppleClang
| AppleClang51
| UnknownCC
deriving CompilerInfo -> CompilerInfo -> Bool
(CompilerInfo -> CompilerInfo -> Bool)
-> (CompilerInfo -> CompilerInfo -> Bool) -> Eq CompilerInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompilerInfo -> CompilerInfo -> Bool
$c/= :: CompilerInfo -> CompilerInfo -> Bool
== :: CompilerInfo -> CompilerInfo -> Bool
$c== :: CompilerInfo -> CompilerInfo -> Bool
Eq
useXLinkerRPath :: DynFlags -> OS -> Bool
useXLinkerRPath :: DynFlags -> OS -> Bool
useXLinkerRPath DynFlags
_ OS
OSDarwin = Bool
False
useXLinkerRPath DynFlags
dflags OS
_ = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_RPath DynFlags
dflags
decodeSize :: String -> Integer
decodeSize :: String -> Integer
decodeSize String
str
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"" = Rational -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate Rational
n
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"K" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"k" = Rational -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Rational
n Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000)
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"M" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"m" = Rational -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Rational
n Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000)
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"G" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"g" = Rational -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Rational
n Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
1000)
| Bool
otherwise = GhcException -> Integer
forall a. GhcException -> a
throwGhcException (String -> GhcException
CmdLineError (String
"can't decode size: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str))
where (String
m, String
c) = (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
span Char -> Bool
pred String
str
n :: Rational
n = String -> Rational
readRational String
m
pred :: Char -> Bool
pred Char
c = Char -> Bool
isDigit Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'.'
foreign import ccall unsafe "ghc_lib_parser_setHeapSize" setHeapSize :: Int -> IO ()
foreign import ccall unsafe "ghc_lib_parser_enableTimingStats" enableTimingStats :: IO ()
initSDocContext :: DynFlags -> PprStyle -> SDocContext
initSDocContext :: DynFlags -> PprStyle -> SDocContext
initSDocContext DynFlags
dflags PprStyle
style = SDC :: PprStyle
-> Scheme
-> PprColour
-> Bool
-> Int
-> Int
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> (FastString -> SDoc)
-> SDocContext
SDC
{ sdocStyle :: PprStyle
sdocStyle = PprStyle
style
, sdocColScheme :: Scheme
sdocColScheme = DynFlags -> Scheme
colScheme DynFlags
dflags
, sdocLastColour :: PprColour
sdocLastColour = PprColour
Col.colReset
, sdocShouldUseColor :: Bool
sdocShouldUseColor = Bool -> OverridingBool -> Bool
overrideWith (DynFlags -> Bool
canUseColor DynFlags
dflags) (DynFlags -> OverridingBool
useColor DynFlags
dflags)
, sdocDefaultDepth :: Int
sdocDefaultDepth = DynFlags -> Int
pprUserLength DynFlags
dflags
, sdocLineLength :: Int
sdocLineLength = DynFlags -> Int
pprCols DynFlags
dflags
, sdocCanUseUnicode :: Bool
sdocCanUseUnicode = DynFlags -> Bool
useUnicode DynFlags
dflags
, sdocHexWordLiterals :: Bool
sdocHexWordLiterals = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_HexWordLiterals DynFlags
dflags
, sdocPprDebug :: Bool
sdocPprDebug = DumpFlag -> DynFlags -> Bool
dopt DumpFlag
Opt_D_ppr_debug DynFlags
dflags
, sdocPrintUnicodeSyntax :: Bool
sdocPrintUnicodeSyntax = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintUnicodeSyntax DynFlags
dflags
, sdocPrintCaseAsLet :: Bool
sdocPrintCaseAsLet = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PprCaseAsLet DynFlags
dflags
, sdocPrintTypecheckerElaboration :: Bool
sdocPrintTypecheckerElaboration = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintTypecheckerElaboration DynFlags
dflags
, sdocPrintAxiomIncomps :: Bool
sdocPrintAxiomIncomps = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintAxiomIncomps DynFlags
dflags
, sdocPrintExplicitKinds :: Bool
sdocPrintExplicitKinds = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintExplicitKinds DynFlags
dflags
, sdocPrintExplicitCoercions :: Bool
sdocPrintExplicitCoercions = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintExplicitCoercions DynFlags
dflags
, sdocPrintExplicitRuntimeReps :: Bool
sdocPrintExplicitRuntimeReps = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintExplicitRuntimeReps DynFlags
dflags
, sdocPrintExplicitForalls :: Bool
sdocPrintExplicitForalls = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintExplicitForalls DynFlags
dflags
, sdocPrintPotentialInstances :: Bool
sdocPrintPotentialInstances = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintPotentialInstances DynFlags
dflags
, sdocPrintEqualityRelations :: Bool
sdocPrintEqualityRelations = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintEqualityRelations DynFlags
dflags
, sdocSuppressTicks :: Bool
sdocSuppressTicks = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressTicks DynFlags
dflags
, sdocSuppressTypeSignatures :: Bool
sdocSuppressTypeSignatures = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressTypeSignatures DynFlags
dflags
, sdocSuppressTypeApplications :: Bool
sdocSuppressTypeApplications = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressTypeApplications DynFlags
dflags
, sdocSuppressIdInfo :: Bool
sdocSuppressIdInfo = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressIdInfo DynFlags
dflags
, sdocSuppressCoercions :: Bool
sdocSuppressCoercions = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressCoercions DynFlags
dflags
, sdocSuppressUnfoldings :: Bool
sdocSuppressUnfoldings = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressUnfoldings DynFlags
dflags
, sdocSuppressVarKinds :: Bool
sdocSuppressVarKinds = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressVarKinds DynFlags
dflags
, sdocSuppressUniques :: Bool
sdocSuppressUniques = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressUniques DynFlags
dflags
, sdocSuppressModulePrefixes :: Bool
sdocSuppressModulePrefixes = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressModulePrefixes DynFlags
dflags
, sdocSuppressStgExts :: Bool
sdocSuppressStgExts = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressStgExts DynFlags
dflags
, sdocErrorSpans :: Bool
sdocErrorSpans = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ErrorSpans DynFlags
dflags
, sdocStarIsType :: Bool
sdocStarIsType = Extension -> DynFlags -> Bool
xopt Extension
LangExt.StarIsType DynFlags
dflags
, sdocImpredicativeTypes :: Bool
sdocImpredicativeTypes = Extension -> DynFlags -> Bool
xopt Extension
LangExt.ImpredicativeTypes DynFlags
dflags
, sdocLinearTypes :: Bool
sdocLinearTypes = Extension -> DynFlags -> Bool
xopt Extension
LangExt.LinearTypes DynFlags
dflags
, sdocListTuplePuns :: Bool
sdocListTuplePuns = Bool
True
, sdocPrintTypeAbbreviations :: Bool
sdocPrintTypeAbbreviations = Bool
True
, sdocUnitIdForUser :: FastString -> SDoc
sdocUnitIdForUser = FastString -> SDoc
ftext
}
initDefaultSDocContext :: DynFlags -> SDocContext
initDefaultSDocContext :: DynFlags -> SDocContext
initDefaultSDocContext DynFlags
dflags = DynFlags -> PprStyle -> SDocContext
initSDocContext DynFlags
dflags PprStyle
defaultUserStyle
outputFile :: DynFlags -> Maybe String
outputFile :: DynFlags -> Maybe String
outputFile DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = DynFlags -> Maybe String
dynOutputFile_ DynFlags
dflags
| Bool
otherwise = DynFlags -> Maybe String
outputFile_ DynFlags
dflags
objectSuf :: DynFlags -> String
objectSuf :: DynFlags -> String
objectSuf DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = DynFlags -> String
dynObjectSuf_ DynFlags
dflags
| Bool
otherwise = DynFlags -> String
objectSuf_ DynFlags
dflags
ways :: DynFlags -> Ways
ways :: DynFlags -> Ways
ways DynFlags
dflags
| DynFlags -> Bool
dynamicNow DynFlags
dflags = Way -> Ways -> Ways
addWay Way
WayDyn (DynFlags -> Ways
targetWays_ DynFlags
dflags)
| Bool
otherwise = DynFlags -> Ways
targetWays_ DynFlags
dflags
pprDynFlagsDiff :: DynFlags -> DynFlags -> SDoc
pprDynFlagsDiff :: DynFlags -> DynFlags -> SDoc
pprDynFlagsDiff DynFlags
d1 DynFlags
d2 =
let gf_removed :: EnumSet GeneralFlag
gf_removed = EnumSet GeneralFlag -> EnumSet GeneralFlag -> EnumSet GeneralFlag
forall a. EnumSet a -> EnumSet a -> EnumSet a
EnumSet.difference (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
d1) (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
d2)
gf_added :: EnumSet GeneralFlag
gf_added = EnumSet GeneralFlag -> EnumSet GeneralFlag -> EnumSet GeneralFlag
forall a. EnumSet a -> EnumSet a -> EnumSet a
EnumSet.difference (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
d2) (DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
d1)
ext_removed :: EnumSet Extension
ext_removed = EnumSet Extension -> EnumSet Extension -> EnumSet Extension
forall a. EnumSet a -> EnumSet a -> EnumSet a
EnumSet.difference (DynFlags -> EnumSet Extension
extensionFlags DynFlags
d1) (DynFlags -> EnumSet Extension
extensionFlags DynFlags
d2)
ext_added :: EnumSet Extension
ext_added = EnumSet Extension -> EnumSet Extension -> EnumSet Extension
forall a. EnumSet a -> EnumSet a -> EnumSet a
EnumSet.difference (DynFlags -> EnumSet Extension
extensionFlags DynFlags
d2) (DynFlags -> EnumSet Extension
extensionFlags DynFlags
d1)
in [SDoc] -> SDoc
vcat
[ String -> SDoc
text String
"Added general flags:"
, String -> SDoc
text (String -> SDoc) -> String -> SDoc
forall a b. (a -> b) -> a -> b
$ [GeneralFlag] -> String
forall a. Show a => a -> String
show ([GeneralFlag] -> String) -> [GeneralFlag] -> String
forall a b. (a -> b) -> a -> b
$ EnumSet GeneralFlag -> [GeneralFlag]
forall a. Enum a => EnumSet a -> [a]
EnumSet.toList (EnumSet GeneralFlag -> [GeneralFlag])
-> EnumSet GeneralFlag -> [GeneralFlag]
forall a b. (a -> b) -> a -> b
$ EnumSet GeneralFlag
gf_added
, String -> SDoc
text String
"Removed general flags:"
, String -> SDoc
text (String -> SDoc) -> String -> SDoc
forall a b. (a -> b) -> a -> b
$ [GeneralFlag] -> String
forall a. Show a => a -> String
show ([GeneralFlag] -> String) -> [GeneralFlag] -> String
forall a b. (a -> b) -> a -> b
$ EnumSet GeneralFlag -> [GeneralFlag]
forall a. Enum a => EnumSet a -> [a]
EnumSet.toList (EnumSet GeneralFlag -> [GeneralFlag])
-> EnumSet GeneralFlag -> [GeneralFlag]
forall a b. (a -> b) -> a -> b
$ EnumSet GeneralFlag
gf_removed
, String -> SDoc
text String
"Added extension flags:"
, String -> SDoc
text (String -> SDoc) -> String -> SDoc
forall a b. (a -> b) -> a -> b
$ [Extension] -> String
forall a. Show a => a -> String
show ([Extension] -> String) -> [Extension] -> String
forall a b. (a -> b) -> a -> b
$ EnumSet Extension -> [Extension]
forall a. Enum a => EnumSet a -> [a]
EnumSet.toList (EnumSet Extension -> [Extension])
-> EnumSet Extension -> [Extension]
forall a b. (a -> b) -> a -> b
$ EnumSet Extension
ext_added
, String -> SDoc
text String
"Removed extension flags:"
, String -> SDoc
text (String -> SDoc) -> String -> SDoc
forall a b. (a -> b) -> a -> b
$ [Extension] -> String
forall a. Show a => a -> String
show ([Extension] -> String) -> [Extension] -> String
forall a b. (a -> b) -> a -> b
$ EnumSet Extension -> [Extension]
forall a. Enum a => EnumSet a -> [a]
EnumSet.toList (EnumSet Extension -> [Extension])
-> EnumSet Extension -> [Extension]
forall a b. (a -> b) -> a -> b
$ EnumSet Extension
ext_removed
]
updatePlatformConstants :: DynFlags -> Maybe PlatformConstants -> IO DynFlags
updatePlatformConstants :: DynFlags -> Maybe PlatformConstants -> IO DynFlags
updatePlatformConstants DynFlags
dflags Maybe PlatformConstants
mconstants = do
let platform1 :: Platform
platform1 = (DynFlags -> Platform
targetPlatform DynFlags
dflags) { platform_constants :: Maybe PlatformConstants
platform_constants = Maybe PlatformConstants
mconstants }
let dflags1 :: DynFlags
dflags1 = DynFlags
dflags { targetPlatform :: Platform
targetPlatform = Platform
platform1 }
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags1