{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-cse #-}
module DynFlags (
DumpFlag(..),
GeneralFlag(..),
WarningFlag(..), WarnReason(..),
Language(..),
PlatformConstants(..),
FatalMessager, LogAction, FlushOut(..), FlushErr(..),
ProfAuto(..),
glasgowExtsFlags,
warningGroups, warningHierarchies,
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,
lang_set,
useUnicodeSyntax,
useStarIsType,
whenGeneratingDynamicToo, ifGeneratingDynamicToo,
whenCannotGenerateDynamicToo,
dynamicTooMkDynamicDynFlags,
DynFlags(..),
FlagSpec(..),
HasDynFlags(..), ContainsDynFlags(..),
RtsOptsEnabled(..),
HscTarget(..), isObjectTarget, defaultObjectTarget,
targetRetainsAllBindings,
GhcMode(..), isOneShot,
GhcLink(..), isNoLink,
PackageFlag(..), PackageArg(..), ModRenaming(..),
packageFlagsChanged,
IgnorePackageFlag(..), TrustFlag(..),
PackageDBFlag(..), PkgConfRef(..),
Option(..), showOpt,
DynLibLoader(..),
fFlags, fLangFlags, xFlags,
wWarningFlags,
dynFlagDependencies,
tablesNextToCode, mkTablesNextToCode,
makeDynFlagsConsistent,
shouldUseColor,
shouldUseHexWordLiterals,
positionIndependent,
optimisationFlags,
Way(..), mkBuildTag, wayRTSOnly, addWay', updateWays,
wayGeneralFlags, wayUnsetGeneralFlags,
thisPackage, thisComponentId, thisUnitIdInsts,
putLogMsg,
SafeHaskellMode(..),
safeHaskellOn, safeHaskellModeEnabled,
safeImportsOn, safeLanguageOn, safeInferOn,
packageTrustOn,
safeDirectImpsReq, safeImplicitImpsReq,
unsafeFlags, unsafeFlagsForInfer,
LlvmTarget(..), LlvmTargets, LlvmPasses, LlvmConfig,
Settings(..),
targetPlatform, programName, projectVersion,
ghcUsagePath, ghciUsagePath, topDir, tmpDir, rawSettings,
versionedAppDir,
extraGccViaCFlags, systemPackageConfig,
pgm_L, pgm_P, pgm_F, pgm_c, pgm_s, pgm_a, pgm_l, pgm_dll, pgm_T,
pgm_windres, pgm_libtool, pgm_ar, pgm_ranlib, pgm_lo, pgm_lc,
pgm_lcc, pgm_i, opt_L, opt_P, opt_F, opt_c, opt_a, opt_l, opt_i,
opt_P_signature,
opt_windres, opt_lo, opt_lc, opt_lcc,
addPluginModuleName,
defaultDynFlags,
defaultWays,
interpWays,
interpreterProfiled, interpreterDynamic,
initDynFlags,
defaultFatalMessager,
defaultLogAction,
defaultLogActionHPrintDoc,
defaultLogActionHPutStrDoc,
defaultFlushOut,
defaultFlushErr,
getOpts,
getVerbFlags,
updOptLevel,
setTmpDir,
setUnitId,
interpretPackageEnv,
canonicalizeHomeModule,
canonicalizeModuleIfHome,
parseDynamicFlagsCmdLine,
parseDynamicFilePragma,
parseDynamicFlagsFull,
allNonDeprecatedFlags,
flagsAll,
flagsDynamic,
flagsPackage,
flagsForCompletion,
supportedLanguagesAndExtensions,
languageExtensions,
picCCOpts, picPOpts,
compilerInfo,
rtsIsProfiled,
dynamicGhc,
#include "GHCConstantsHaskellExports.hs"
bLOCK_SIZE_W,
wORD_SIZE_IN_BITS,
tAG_MASK,
mAX_PTR_TAG,
tARGET_MIN_INT, tARGET_MAX_INT, tARGET_MAX_WORD,
unsafeGlobalDynFlags, setUnsafeGlobalDynFlags,
isSseEnabled,
isSse2Enabled,
isSse4_2Enabled,
isBmiEnabled,
isBmi2Enabled,
isAvxEnabled,
isAvx2Enabled,
isAvx512cdEnabled,
isAvx512erEnabled,
isAvx512fEnabled,
isAvx512pfEnabled,
LinkerInfo(..),
CompilerInfo(..),
FilesToClean(..), emptyFilesToClean,
IncludeSpecs(..), addGlobalInclude, addQuoteInclude, flattenIncludes,
CfgWeights(..), backendMaintainsCfg
) where
#include "HsVersions.h"
import GhcPrelude
import Platform
import PlatformConstants
import Module
import PackageConfig
import {-# SOURCE #-} Plugins
import {-# SOURCE #-} Hooks
import {-# SOURCE #-} PrelNames ( mAIN )
import {-# SOURCE #-} Packages (PackageState, emptyPackageState)
import DriverPhases ( Phase(..), phaseInputExt )
import Config
import CmdLineParser hiding (WarnReason(..))
import qualified CmdLineParser as Cmd
import Constants
import Panic
import qualified PprColour as Col
import Util
import Maybes
import MonadUtils
import qualified Pretty
import SrcLoc
import BasicTypes ( IntWithInf, treatZeroAsInf )
import FastString
import Fingerprint
import Outputable
import Foreign.C ( CInt(..) )
import System.IO.Unsafe ( unsafeDupablePerformIO )
import {-# SOURCE #-} ErrUtils ( Severity(..), MsgDoc, mkLocMessageAnn
, getCaretDiagnostic )
import Json
import SysTools.Terminal ( stderrSupportsAnsiColors )
import SysTools.BaseDir ( expandToolDir, expandTopDir )
import System.IO.Unsafe ( unsafePerformIO )
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.Exception (throwIO)
import Data.Ord
import Data.Bits
import Data.Char
import Data.Int
import Data.List
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Word
import System.FilePath
import System.Directory
import System.Environment (getEnv, lookupEnv)
import System.IO
import System.IO.Error
import Text.ParserCombinators.ReadP hiding (char)
import Text.ParserCombinators.ReadP as R
import EnumSet (EnumSet)
import qualified EnumSet
import GHC.Foreign (withCString, peekCString)
import qualified GHC.LanguageExtensions as LangExt
import Foreign (Ptr)
data DumpFlag
= Opt_D_dump_cmm
| Opt_D_dump_cmm_from_stg
| Opt_D_dump_cmm_raw
| Opt_D_dump_cmm_verbose
| Opt_D_dump_cmm_cfg
| Opt_D_dump_cmm_cbe
| Opt_D_dump_cmm_switch
| Opt_D_dump_cmm_proc
| Opt_D_dump_cmm_sp
| Opt_D_dump_cmm_sink
| Opt_D_dump_cmm_caf
| Opt_D_dump_cmm_procmap
| Opt_D_dump_cmm_split
| Opt_D_dump_cmm_info
| Opt_D_dump_cmm_cps
| Opt_D_dump_cfg_weights
| Opt_D_dump_asm
| Opt_D_dump_asm_native
| Opt_D_dump_asm_liveness
| Opt_D_dump_asm_regalloc
| Opt_D_dump_asm_regalloc_stages
| Opt_D_dump_asm_conflicts
| Opt_D_dump_asm_stats
| Opt_D_dump_asm_expanded
| Opt_D_dump_llvm
| Opt_D_dump_core_stats
| Opt_D_dump_deriv
| Opt_D_dump_ds
| Opt_D_dump_ds_preopt
| Opt_D_dump_foreign
| Opt_D_dump_inlinings
| Opt_D_dump_rule_firings
| Opt_D_dump_rule_rewrites
| Opt_D_dump_simpl_trace
| Opt_D_dump_occur_anal
| Opt_D_dump_parsed
| Opt_D_dump_parsed_ast
| Opt_D_dump_rn
| Opt_D_dump_rn_ast
| Opt_D_dump_shape
| Opt_D_dump_simpl
| Opt_D_dump_simpl_iterations
| Opt_D_dump_spec
| Opt_D_dump_prep
| Opt_D_dump_stg
| Opt_D_dump_call_arity
| Opt_D_dump_exitify
| Opt_D_dump_stranal
| Opt_D_dump_str_signatures
| Opt_D_dump_tc
| Opt_D_dump_tc_ast
| Opt_D_dump_types
| Opt_D_dump_rules
| Opt_D_dump_cse
| Opt_D_dump_worker_wrapper
| Opt_D_dump_rn_trace
| Opt_D_dump_rn_stats
| Opt_D_dump_opt_cmm
| Opt_D_dump_simpl_stats
| Opt_D_dump_cs_trace
| Opt_D_dump_tc_trace
| Opt_D_dump_ec_trace
| Opt_D_dump_if_trace
| Opt_D_dump_vt_trace
| Opt_D_dump_splices
| Opt_D_th_dec_file
| Opt_D_dump_BCOs
| Opt_D_dump_ticked
| Opt_D_dump_rtti
| Opt_D_source_stats
| Opt_D_verbose_stg2stg
| Opt_D_dump_hi
| Opt_D_dump_hi_diffs
| Opt_D_dump_mod_cycles
| Opt_D_dump_mod_map
| Opt_D_dump_timings
| Opt_D_dump_view_pattern_commoning
| Opt_D_verbose_core2core
| Opt_D_dump_debug
| Opt_D_dump_json
| Opt_D_ppr_debug
| Opt_D_no_debug_output
deriving (DumpFlag -> DumpFlag -> Bool
(DumpFlag -> DumpFlag -> Bool)
-> (DumpFlag -> DumpFlag -> Bool) -> Eq DumpFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DumpFlag -> DumpFlag -> Bool
$c/= :: DumpFlag -> DumpFlag -> Bool
== :: DumpFlag -> DumpFlag -> Bool
$c== :: DumpFlag -> DumpFlag -> Bool
Eq, Int -> DumpFlag -> ShowS
[DumpFlag] -> ShowS
DumpFlag -> String
(Int -> DumpFlag -> ShowS)
-> (DumpFlag -> String) -> ([DumpFlag] -> ShowS) -> Show DumpFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DumpFlag] -> ShowS
$cshowList :: [DumpFlag] -> ShowS
show :: DumpFlag -> String
$cshow :: DumpFlag -> String
showsPrec :: Int -> DumpFlag -> ShowS
$cshowsPrec :: Int -> DumpFlag -> ShowS
Show, Int -> DumpFlag
DumpFlag -> Int
DumpFlag -> [DumpFlag]
DumpFlag -> DumpFlag
DumpFlag -> DumpFlag -> [DumpFlag]
DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
(DumpFlag -> DumpFlag)
-> (DumpFlag -> DumpFlag)
-> (Int -> DumpFlag)
-> (DumpFlag -> Int)
-> (DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag])
-> Enum DumpFlag
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 :: DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
$cenumFromThenTo :: DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
enumFromTo :: DumpFlag -> DumpFlag -> [DumpFlag]
$cenumFromTo :: DumpFlag -> DumpFlag -> [DumpFlag]
enumFromThen :: DumpFlag -> DumpFlag -> [DumpFlag]
$cenumFromThen :: DumpFlag -> DumpFlag -> [DumpFlag]
enumFrom :: DumpFlag -> [DumpFlag]
$cenumFrom :: DumpFlag -> [DumpFlag]
fromEnum :: DumpFlag -> Int
$cfromEnum :: DumpFlag -> Int
toEnum :: Int -> DumpFlag
$ctoEnum :: Int -> DumpFlag
pred :: DumpFlag -> DumpFlag
$cpred :: DumpFlag -> DumpFlag
succ :: DumpFlag -> DumpFlag
$csucc :: DumpFlag -> DumpFlag
Enum)
data GeneralFlag
= Opt_DumpToFile
| Opt_D_faststring_stats
| Opt_D_dump_minimal_imports
| Opt_DoCoreLinting
| Opt_DoStgLinting
| Opt_DoCmmLinting
| Opt_DoAsmLinting
| Opt_DoAnnotationLinting
| Opt_NoLlvmMangler
| Opt_FastLlvm
| Opt_WarnIsError
| Opt_ShowWarnGroups
| Opt_HideSourcePaths
| Opt_PrintExplicitForalls
| Opt_PrintExplicitKinds
| Opt_PrintExplicitCoercions
| Opt_PrintExplicitRuntimeReps
| Opt_PrintEqualityRelations
| Opt_PrintUnicodeSyntax
| Opt_PrintExpandedSynonyms
| Opt_PrintPotentialInstances
| Opt_PrintTypecheckerElaboration
| Opt_CallArity
| Opt_Exitification
| Opt_Strictness
| Opt_LateDmdAnal
| Opt_KillAbsence
| Opt_KillOneShot
| Opt_FullLaziness
| Opt_FloatIn
| Opt_LateSpecialise
| Opt_Specialise
| Opt_SpecialiseAggressively
| Opt_CrossModuleSpecialise
| Opt_StaticArgumentTransformation
| Opt_CSE
| Opt_StgCSE
| Opt_StgLiftLams
| Opt_LiberateCase
| Opt_SpecConstr
| Opt_SpecConstrKeen
| Opt_DoLambdaEtaExpansion
| Opt_IgnoreAsserts
| Opt_DoEtaReduction
| Opt_CaseMerge
| Opt_CaseFolding
| Opt_UnboxStrictFields
| Opt_UnboxSmallStrictFields
| Opt_DictsCheap
| Opt_EnableRewriteRules
| Opt_RegsGraph
| Opt_RegsIterative
| Opt_PedanticBottoms
| Opt_LlvmTBAA
| Opt_LlvmFillUndefWithGarbage
| Opt_IrrefutableTuples
| Opt_CmmSink
| Opt_CmmElimCommonBlocks
| Opt_AsmShortcutting
| Opt_OmitYields
| Opt_FunToThunk
| Opt_DictsStrict
| Opt_DmdTxDictSel
| Opt_Loopification
| Opt_CfgBlocklayout
| Opt_WeightlessBlocklayout
| Opt_CprAnal
| Opt_WorkerWrapper
| Opt_SolveConstantDicts
| Opt_AlignmentSanitisation
| Opt_CatchBottoms
| Opt_NumConstantFolding
| Opt_SimplPreInlining
| Opt_IgnoreInterfacePragmas
| Opt_OmitInterfacePragmas
| Opt_ExposeAllUnfoldings
| Opt_WriteInterface
| Opt_WriteHie
| Opt_AutoSccsOnIndividualCafs
| Opt_ProfCountEntries
| Opt_Pp
| Opt_ForceRecomp
| Opt_IgnoreOptimChanges
| Opt_IgnoreHpcChanges
| Opt_ExcessPrecision
| Opt_EagerBlackHoling
| Opt_NoHsMain
| Opt_SplitObjs
| Opt_SplitSections
| Opt_StgStats
| Opt_HideAllPackages
| Opt_HideAllPluginPackages
| Opt_PrintBindResult
| Opt_Haddock
| Opt_HaddockOptions
| Opt_BreakOnException
| Opt_BreakOnError
| Opt_PrintEvldWithShow
| Opt_PrintBindContents
| Opt_GenManifest
| Opt_EmbedManifest
| Opt_SharedImplib
| Opt_BuildingCabalPackage
| Opt_IgnoreDotGhci
| Opt_GhciSandbox
| Opt_GhciHistory
| Opt_GhciLeakCheck
| Opt_ValidateHie
| Opt_LocalGhciHistory
| Opt_NoIt
| Opt_HelpfulErrors
| Opt_DeferTypeErrors
| Opt_DeferTypedHoles
| Opt_DeferOutOfScopeVariables
| Opt_PIC
| Opt_PIE
| Opt_PICExecutable
| Opt_ExternalDynamicRefs
| Opt_SccProfilingOn
| Opt_Ticky
| Opt_Ticky_Allocd
| Opt_Ticky_LNE
| Opt_Ticky_Dyn_Thunk
| Opt_RPath
| Opt_RelativeDynlibPaths
| Opt_Hpc
| Opt_FlatCache
| Opt_ExternalInterpreter
| Opt_OptimalApplicativeDo
| Opt_VersionMacros
| Opt_WholeArchiveHsLibs
| Opt_SingleLibFolder
| Opt_KeepCAFs
| Opt_ErrorSpans
| Opt_DiagnosticsShowCaret
| Opt_PprCaseAsLet
| Opt_PprShowTicks
| Opt_ShowHoleConstraints
| Opt_ShowValidHoleFits
| Opt_SortValidHoleFits
| Opt_SortBySizeHoleFits
| Opt_SortBySubsumHoleFits
| Opt_AbstractRefHoleFits
| Opt_UnclutterValidHoleFits
| Opt_ShowTypeAppOfHoleFits
| Opt_ShowTypeAppVarsOfHoleFits
| Opt_ShowDocsOfHoleFits
| Opt_ShowTypeOfHoleFits
| Opt_ShowProvOfHoleFits
| Opt_ShowMatchesOfHoleFits
| Opt_ShowLoadedModules
| Opt_HexWordLiterals
| Opt_SuppressCoercions
| Opt_SuppressVarKinds
| Opt_SuppressModulePrefixes
| Opt_SuppressTypeApplications
| Opt_SuppressIdInfo
| Opt_SuppressUnfoldings
| Opt_SuppressTypeSignatures
| Opt_SuppressUniques
| Opt_SuppressStgExts
| Opt_SuppressTicks
| Opt_SuppressTimestamps
| Opt_AutoLinkPackages
| Opt_ImplicitImportQualified
| Opt_KeepHscppFiles
| Opt_KeepHiDiffs
| Opt_KeepHcFiles
| Opt_KeepSFiles
| Opt_KeepTmpFiles
| Opt_KeepRawTokenStream
| Opt_KeepLlvmFiles
| Opt_KeepHiFiles
| Opt_KeepOFiles
| Opt_BuildDynamicToo
| Opt_DistrustAllPackages
| Opt_PackageTrust
| Opt_G_NoStateHack
| Opt_G_NoOptCoercion
deriving (GeneralFlag -> GeneralFlag -> Bool
(GeneralFlag -> GeneralFlag -> Bool)
-> (GeneralFlag -> GeneralFlag -> Bool) -> Eq GeneralFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeneralFlag -> GeneralFlag -> Bool
$c/= :: GeneralFlag -> GeneralFlag -> Bool
== :: GeneralFlag -> GeneralFlag -> Bool
$c== :: GeneralFlag -> GeneralFlag -> Bool
Eq, Int -> GeneralFlag -> ShowS
[GeneralFlag] -> ShowS
GeneralFlag -> String
(Int -> GeneralFlag -> ShowS)
-> (GeneralFlag -> String)
-> ([GeneralFlag] -> ShowS)
-> Show GeneralFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeneralFlag] -> ShowS
$cshowList :: [GeneralFlag] -> ShowS
show :: GeneralFlag -> String
$cshow :: GeneralFlag -> String
showsPrec :: Int -> GeneralFlag -> ShowS
$cshowsPrec :: Int -> GeneralFlag -> ShowS
Show, Int -> GeneralFlag
GeneralFlag -> Int
GeneralFlag -> [GeneralFlag]
GeneralFlag -> GeneralFlag
GeneralFlag -> GeneralFlag -> [GeneralFlag]
GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
(GeneralFlag -> GeneralFlag)
-> (GeneralFlag -> GeneralFlag)
-> (Int -> GeneralFlag)
-> (GeneralFlag -> Int)
-> (GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> Enum GeneralFlag
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 :: GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
$cenumFromThenTo :: GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFromTo :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
$cenumFromTo :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFromThen :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
$cenumFromThen :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFrom :: GeneralFlag -> [GeneralFlag]
$cenumFrom :: GeneralFlag -> [GeneralFlag]
fromEnum :: GeneralFlag -> Int
$cfromEnum :: GeneralFlag -> Int
toEnum :: Int -> GeneralFlag
$ctoEnum :: Int -> GeneralFlag
pred :: GeneralFlag -> GeneralFlag
$cpred :: GeneralFlag -> GeneralFlag
succ :: GeneralFlag -> GeneralFlag
$csucc :: GeneralFlag -> GeneralFlag
Enum)
optimisationFlags :: EnumSet GeneralFlag
optimisationFlags :: EnumSet GeneralFlag
optimisationFlags = [GeneralFlag] -> EnumSet GeneralFlag
forall a. Enum a => [a] -> EnumSet a
EnumSet.fromList
[ GeneralFlag
Opt_CallArity
, GeneralFlag
Opt_Strictness
, GeneralFlag
Opt_LateDmdAnal
, GeneralFlag
Opt_KillAbsence
, GeneralFlag
Opt_KillOneShot
, GeneralFlag
Opt_FullLaziness
, GeneralFlag
Opt_FloatIn
, GeneralFlag
Opt_LateSpecialise
, GeneralFlag
Opt_Specialise
, GeneralFlag
Opt_SpecialiseAggressively
, GeneralFlag
Opt_CrossModuleSpecialise
, GeneralFlag
Opt_StaticArgumentTransformation
, GeneralFlag
Opt_CSE
, GeneralFlag
Opt_StgCSE
, GeneralFlag
Opt_StgLiftLams
, GeneralFlag
Opt_LiberateCase
, GeneralFlag
Opt_SpecConstr
, GeneralFlag
Opt_SpecConstrKeen
, GeneralFlag
Opt_DoLambdaEtaExpansion
, GeneralFlag
Opt_IgnoreAsserts
, GeneralFlag
Opt_DoEtaReduction
, GeneralFlag
Opt_CaseMerge
, GeneralFlag
Opt_CaseFolding
, GeneralFlag
Opt_UnboxStrictFields
, GeneralFlag
Opt_UnboxSmallStrictFields
, GeneralFlag
Opt_DictsCheap
, GeneralFlag
Opt_EnableRewriteRules
, GeneralFlag
Opt_RegsGraph
, GeneralFlag
Opt_RegsIterative
, GeneralFlag
Opt_PedanticBottoms
, GeneralFlag
Opt_LlvmTBAA
, GeneralFlag
Opt_LlvmFillUndefWithGarbage
, GeneralFlag
Opt_IrrefutableTuples
, GeneralFlag
Opt_CmmSink
, GeneralFlag
Opt_CmmElimCommonBlocks
, GeneralFlag
Opt_AsmShortcutting
, GeneralFlag
Opt_OmitYields
, GeneralFlag
Opt_FunToThunk
, GeneralFlag
Opt_DictsStrict
, GeneralFlag
Opt_DmdTxDictSel
, GeneralFlag
Opt_Loopification
, GeneralFlag
Opt_CfgBlocklayout
, GeneralFlag
Opt_WeightlessBlocklayout
, GeneralFlag
Opt_CprAnal
, GeneralFlag
Opt_WorkerWrapper
, GeneralFlag
Opt_SolveConstantDicts
, GeneralFlag
Opt_CatchBottoms
, GeneralFlag
Opt_IgnoreAsserts
]
data WarnReason
= NoReason
| Reason !WarningFlag
| ErrReason !(Maybe WarningFlag)
deriving Int -> WarnReason -> ShowS
[WarnReason] -> ShowS
WarnReason -> String
(Int -> WarnReason -> ShowS)
-> (WarnReason -> String)
-> ([WarnReason] -> ShowS)
-> Show WarnReason
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WarnReason] -> ShowS
$cshowList :: [WarnReason] -> ShowS
show :: WarnReason -> String
$cshow :: WarnReason -> String
showsPrec :: Int -> WarnReason -> ShowS
$cshowsPrec :: Int -> WarnReason -> ShowS
Show
data IncludeSpecs
= IncludeSpecs { IncludeSpecs -> [String]
includePathsQuote :: [String]
, IncludeSpecs -> [String]
includePathsGlobal :: [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 spec :: IncludeSpecs
spec paths :: [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 spec :: IncludeSpecs
spec paths :: [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 }
flattenIncludes :: IncludeSpecs -> [String]
flattenIncludes :: IncludeSpecs -> [String]
flattenIncludes specs :: IncludeSpecs
specs = IncludeSpecs -> [String]
includePathsQuote IncludeSpecs
specs [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ IncludeSpecs -> [String]
includePathsGlobal IncludeSpecs
specs
instance Outputable WarnReason where
ppr :: WarnReason -> SDoc
ppr = String -> SDoc
text (String -> SDoc) -> (WarnReason -> String) -> WarnReason -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WarnReason -> String
forall a. Show a => a -> String
show
instance ToJson WarnReason where
json :: WarnReason -> JsonDoc
json NoReason = JsonDoc
JSNull
json (Reason wf :: WarningFlag
wf) = String -> JsonDoc
JSString (WarningFlag -> String
forall a. Show a => a -> String
show WarningFlag
wf)
json (ErrReason Nothing) = String -> JsonDoc
JSString "Opt_WarnIsError"
json (ErrReason (Just wf :: WarningFlag
wf)) = String -> JsonDoc
JSString (WarningFlag -> String
forall a. Show a => a -> String
show WarningFlag
wf)
data WarningFlag =
Opt_WarnDuplicateExports
| Opt_WarnDuplicateConstraints
| Opt_WarnRedundantConstraints
| Opt_WarnHiShadows
| Opt_WarnImplicitPrelude
| Opt_WarnIncompletePatterns
| Opt_WarnIncompleteUniPatterns
| Opt_WarnIncompletePatternsRecUpd
| Opt_WarnOverflowedLiterals
| Opt_WarnEmptyEnumerations
| Opt_WarnMissingFields
| Opt_WarnMissingImportList
| Opt_WarnMissingMethods
| Opt_WarnMissingSignatures
| Opt_WarnMissingLocalSignatures
| Opt_WarnNameShadowing
| Opt_WarnOverlappingPatterns
| Opt_WarnTypeDefaults
| Opt_WarnMonomorphism
| Opt_WarnUnusedTopBinds
| Opt_WarnUnusedLocalBinds
| Opt_WarnUnusedPatternBinds
| Opt_WarnUnusedImports
| Opt_WarnUnusedMatches
| Opt_WarnUnusedTypePatterns
| Opt_WarnUnusedForalls
| Opt_WarnWarningsDeprecations
| Opt_WarnDeprecatedFlags
| Opt_WarnMissingMonadFailInstances
| Opt_WarnSemigroup
| Opt_WarnDodgyExports
| Opt_WarnDodgyImports
| Opt_WarnOrphans
| Opt_WarnAutoOrphans
| Opt_WarnIdentities
| Opt_WarnTabs
| Opt_WarnUnrecognisedPragmas
| Opt_WarnDodgyForeignImports
| Opt_WarnUnusedDoBind
| Opt_WarnWrongDoBind
| Opt_WarnAlternativeLayoutRuleTransitional
| Opt_WarnUnsafe
| Opt_WarnSafe
| Opt_WarnTrustworthySafe
| Opt_WarnMissedSpecs
| Opt_WarnAllMissedSpecs
| Opt_WarnUnsupportedCallingConventions
| Opt_WarnUnsupportedLlvmVersion
|
| Opt_WarnInlineRuleShadowing
| Opt_WarnTypedHoles
| Opt_WarnPartialTypeSignatures
| Opt_WarnMissingExportedSignatures
| Opt_WarnUntickedPromotedConstructors
| Opt_WarnDerivingTypeable
| Opt_WarnDeferredTypeErrors
| Opt_WarnDeferredOutOfScopeVariables
| Opt_WarnNonCanonicalMonadInstances
| Opt_WarnNonCanonicalMonadFailInstances
| Opt_WarnNonCanonicalMonoidInstances
| Opt_WarnMissingPatternSynonymSignatures
| Opt_WarnUnrecognisedWarningFlags
| Opt_WarnSimplifiableClassConstraints
| Opt_WarnCPPUndef
| Opt_WarnUnbangedStrictPatterns
| Opt_WarnMissingHomeModules
| Opt_WarnPartialFields
| Opt_WarnMissingExportList
| Opt_WarnInaccessibleCode
| Opt_WarnStarIsType
| Opt_WarnStarBinder
| Opt_WarnImplicitKindVars
| Opt_WarnSpaceAfterBang
| Opt_WarnMissingDerivingStrategies
deriving (WarningFlag -> WarningFlag -> Bool
(WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> Bool) -> Eq WarningFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WarningFlag -> WarningFlag -> Bool
$c/= :: WarningFlag -> WarningFlag -> Bool
== :: WarningFlag -> WarningFlag -> Bool
$c== :: WarningFlag -> WarningFlag -> Bool
Eq, Int -> WarningFlag -> ShowS
[WarningFlag] -> ShowS
WarningFlag -> String
(Int -> WarningFlag -> ShowS)
-> (WarningFlag -> String)
-> ([WarningFlag] -> ShowS)
-> Show WarningFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WarningFlag] -> ShowS
$cshowList :: [WarningFlag] -> ShowS
show :: WarningFlag -> String
$cshow :: WarningFlag -> String
showsPrec :: Int -> WarningFlag -> ShowS
$cshowsPrec :: Int -> WarningFlag -> ShowS
Show, Int -> WarningFlag
WarningFlag -> Int
WarningFlag -> [WarningFlag]
WarningFlag -> WarningFlag
WarningFlag -> WarningFlag -> [WarningFlag]
WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
(WarningFlag -> WarningFlag)
-> (WarningFlag -> WarningFlag)
-> (Int -> WarningFlag)
-> (WarningFlag -> Int)
-> (WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag])
-> Enum WarningFlag
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 :: WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
$cenumFromThenTo :: WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
enumFromTo :: WarningFlag -> WarningFlag -> [WarningFlag]
$cenumFromTo :: WarningFlag -> WarningFlag -> [WarningFlag]
enumFromThen :: WarningFlag -> WarningFlag -> [WarningFlag]
$cenumFromThen :: WarningFlag -> WarningFlag -> [WarningFlag]
enumFrom :: WarningFlag -> [WarningFlag]
$cenumFrom :: WarningFlag -> [WarningFlag]
fromEnum :: WarningFlag -> Int
$cfromEnum :: WarningFlag -> Int
toEnum :: Int -> WarningFlag
$ctoEnum :: Int -> WarningFlag
pred :: WarningFlag -> WarningFlag
$cpred :: WarningFlag -> WarningFlag
succ :: WarningFlag -> WarningFlag
$csucc :: WarningFlag -> WarningFlag
Enum)
data Language = Haskell98 | Haskell2010
deriving (Language -> Language -> Bool
(Language -> Language -> Bool)
-> (Language -> Language -> Bool) -> Eq Language
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Language -> Language -> Bool
$c/= :: Language -> Language -> Bool
== :: Language -> Language -> Bool
$c== :: Language -> Language -> Bool
Eq, Int -> Language
Language -> Int
Language -> [Language]
Language -> Language
Language -> Language -> [Language]
Language -> Language -> Language -> [Language]
(Language -> Language)
-> (Language -> Language)
-> (Int -> Language)
-> (Language -> Int)
-> (Language -> [Language])
-> (Language -> Language -> [Language])
-> (Language -> Language -> [Language])
-> (Language -> Language -> Language -> [Language])
-> Enum Language
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 :: Language -> Language -> Language -> [Language]
$cenumFromThenTo :: Language -> Language -> Language -> [Language]
enumFromTo :: Language -> Language -> [Language]
$cenumFromTo :: Language -> Language -> [Language]
enumFromThen :: Language -> Language -> [Language]
$cenumFromThen :: Language -> Language -> [Language]
enumFrom :: Language -> [Language]
$cenumFrom :: Language -> [Language]
fromEnum :: Language -> Int
$cfromEnum :: Language -> Int
toEnum :: Int -> Language
$ctoEnum :: Int -> Language
pred :: Language -> Language
$cpred :: Language -> Language
succ :: Language -> Language
$csucc :: Language -> Language
Enum, Int -> Language -> ShowS
[Language] -> ShowS
Language -> String
(Int -> Language -> ShowS)
-> (Language -> String) -> ([Language] -> ShowS) -> Show Language
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Language] -> ShowS
$cshowList :: [Language] -> ShowS
show :: Language -> String
$cshow :: Language -> String
showsPrec :: Int -> Language -> ShowS
$cshowsPrec :: Int -> Language -> ShowS
Show)
instance Outputable Language where
ppr :: Language -> SDoc
ppr = String -> SDoc
text (String -> SDoc) -> (Language -> String) -> Language -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Language -> String
forall a. Show a => a -> String
show
data SafeHaskellMode
= Sf_None
| Sf_Unsafe
| Sf_Trustworthy
| Sf_Safe
| Sf_Ignore
deriving (SafeHaskellMode -> SafeHaskellMode -> Bool
(SafeHaskellMode -> SafeHaskellMode -> Bool)
-> (SafeHaskellMode -> SafeHaskellMode -> Bool)
-> Eq SafeHaskellMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SafeHaskellMode -> SafeHaskellMode -> Bool
$c/= :: SafeHaskellMode -> SafeHaskellMode -> Bool
== :: SafeHaskellMode -> SafeHaskellMode -> Bool
$c== :: SafeHaskellMode -> SafeHaskellMode -> Bool
Eq)
instance Show SafeHaskellMode where
show :: SafeHaskellMode -> String
show Sf_None = "None"
show Sf_Unsafe = "Unsafe"
show Sf_Trustworthy = "Trustworthy"
show Sf_Safe = "Safe"
show Sf_Ignore = "Ignore"
instance Outputable SafeHaskellMode where
ppr :: SafeHaskellMode -> SDoc
ppr = String -> SDoc
text (String -> SDoc)
-> (SafeHaskellMode -> String) -> SafeHaskellMode -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SafeHaskellMode -> String
forall a. Show a => a -> String
show
data DynFlags = DynFlags {
DynFlags -> GhcMode
ghcMode :: GhcMode,
DynFlags -> GhcLink
ghcLink :: GhcLink,
DynFlags -> HscTarget
hscTarget :: HscTarget,
DynFlags -> Settings
settings :: Settings,
DynFlags -> IntegerLibrary
integerLibrary :: IntegerLibrary,
DynFlags -> LlvmTargets
llvmTargets :: LlvmTargets,
DynFlags -> LlvmPasses
llvmPasses :: LlvmPasses,
DynFlags -> Int
verbosity :: Int,
DynFlags -> Int
optLevel :: Int,
DynFlags -> Int
debugLevel :: Int,
DynFlags -> Int
simplPhases :: Int,
DynFlags -> Int
maxSimplIterations :: Int,
DynFlags -> Int
maxPmCheckIterations :: Int,
DynFlags -> Maybe String
ruleCheck :: Maybe String,
DynFlags -> Maybe String
inlineCheck :: 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
simplTickFactor :: Int,
DynFlags -> Maybe Int
specConstrThreshold :: Maybe Int,
DynFlags -> Maybe Int
specConstrCount :: Maybe Int,
DynFlags -> Int
specConstrRecursive :: Int,
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 -> Module
mainModIs :: Module,
DynFlags -> Maybe String
mainFunIs :: Maybe String,
DynFlags -> IntWithInf
reductionDepth :: IntWithInf,
DynFlags -> IntWithInf
solverIterations :: IntWithInf,
DynFlags -> InstalledUnitId
thisInstalledUnitId :: InstalledUnitId,
DynFlags -> Maybe ComponentId
thisComponentId_ :: Maybe ComponentId,
DynFlags -> Maybe [(ModuleName, Module)]
thisUnitIdInsts_ :: Maybe [(ModuleName, Module)],
DynFlags -> [Way]
ways :: [Way],
DynFlags -> String
buildTag :: String,
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 -> IORef Bool
canGenerateDynamicToo :: IORef Bool,
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 -> DynLibLoader
dynLibLoader :: DynLibLoader,
DynFlags -> Maybe String
dumpPrefix :: Maybe 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 -> [LoadedPlugin]
cachedPlugins :: [LoadedPlugin],
DynFlags -> [StaticPlugin]
staticPlugins :: [StaticPlugin],
DynFlags -> Hooks
hooks :: Hooks,
DynFlags -> String
depMakefile :: FilePath,
DynFlags -> Bool
depIncludePkgDeps :: 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 -> Maybe [(String, [PackageConfig])]
pkgDatabase :: Maybe [(FilePath, [PackageConfig])],
DynFlags -> PackageState
pkgState :: PackageState,
DynFlags -> IORef FilesToClean
filesToClean :: IORef FilesToClean,
DynFlags -> IORef (Map String String)
dirsToClean :: IORef (Map FilePath FilePath),
DynFlags -> IORef Int
nextTempSuffix :: IORef Int,
DynFlags -> IORef (Set String)
generatedDumps :: IORef (Set 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
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 -> Int
ufCreationThreshold :: Int,
DynFlags -> Int
ufUseThreshold :: Int,
DynFlags -> Int
ufFunAppDiscount :: Int,
DynFlags -> Int
ufDictDiscount :: Int,
DynFlags -> Float
ufKeenessFactor :: Float,
DynFlags -> Int
ufDearOp :: Int,
DynFlags -> Bool
ufVeryAggressive :: Bool,
DynFlags -> Int
maxWorkerArgs :: Int,
DynFlags -> Int
ghciHistSize :: Int,
DynFlags -> LogAction
log_action :: LogAction,
DynFlags -> FlushOut
flushOut :: FlushOut,
DynFlags -> FlushErr
flushErr :: FlushErr,
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 -> Maybe String
interactivePrint :: Maybe String,
DynFlags -> IORef (ModuleEnv Int)
nextWrapperNum :: IORef (ModuleEnv Int),
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 -> Int
maxInlineAllocSize :: Int,
DynFlags -> Int
maxInlineMemcpyInsns :: Int,
DynFlags -> Int
maxInlineMemsetInsns :: Int,
DynFlags -> Bool
reverseErrors :: Bool,
DynFlags -> Maybe Int
maxErrors :: Maybe Int,
DynFlags -> Int
initialUnique :: Int,
DynFlags -> Int
uniqueIncrement :: Int,
DynFlags -> CfgWeights
cfgWeightInfo :: CfgWeights
}
data CfgWeights
= CFGWeights
{ CfgWeights -> Int
uncondWeight :: Int
, CfgWeights -> Int
condBranchWeight :: Int
, CfgWeights -> Int
switchWeight :: Int
, CfgWeights -> Int
callWeight :: Int
, CfgWeights -> Int
likelyCondWeight :: Int
, CfgWeights -> Int
unlikelyCondWeight :: Int
, CfgWeights -> Int
infoTablePenalty :: Int
, CfgWeights -> Int
backEdgeBonus :: Int
}
defaultCfgWeights :: CfgWeights
defaultCfgWeights :: CfgWeights
defaultCfgWeights
= CFGWeights :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> CfgWeights
CFGWeights
{ uncondWeight :: Int
uncondWeight = 1000
, condBranchWeight :: Int
condBranchWeight = 800
, switchWeight :: Int
switchWeight = 1
, callWeight :: Int
callWeight = -10
, likelyCondWeight :: Int
likelyCondWeight = 900
, unlikelyCondWeight :: Int
unlikelyCondWeight = 300
, infoTablePenalty :: Int
infoTablePenalty = 300
, backEdgeBonus :: Int
backEdgeBonus = 400
}
parseCfgWeights :: String -> CfgWeights -> CfgWeights
parseCfgWeights :: String -> CfgWeights -> CfgWeights
parseCfgWeights s :: String
s oldWeights :: CfgWeights
oldWeights =
(CfgWeights -> (String, Int) -> CfgWeights)
-> CfgWeights -> [(String, Int)] -> CfgWeights
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl' (\cfg :: CfgWeights
cfg (n :: String
n,v :: Int
v) -> String -> Int -> CfgWeights -> CfgWeights
update String
n Int
v CfgWeights
cfg) CfgWeights
oldWeights [(String, Int)]
assignments
where
assignments :: [(String, Int)]
assignments = (String -> (String, Int)) -> [String] -> [(String, Int)]
forall a b. (a -> b) -> [a] -> [b]
map String -> (String, Int)
forall b. Read b => String -> (String, b)
assignment ([String] -> [(String, Int)]) -> [String] -> [(String, Int)]
forall a b. (a -> b) -> a -> b
$ String -> [String]
settings String
s
update :: String -> Int -> CfgWeights -> CfgWeights
update "uncondWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {uncondWeight :: Int
uncondWeight = Int
n}
update "condBranchWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {condBranchWeight :: Int
condBranchWeight = Int
n}
update "switchWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {switchWeight :: Int
switchWeight = Int
n}
update "callWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {callWeight :: Int
callWeight = Int
n}
update "likelyCondWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {likelyCondWeight :: Int
likelyCondWeight = Int
n}
update "unlikelyCondWeight" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {unlikelyCondWeight :: Int
unlikelyCondWeight = Int
n}
update "infoTablePenalty" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {infoTablePenalty :: Int
infoTablePenalty = Int
n}
update "backEdgeBonus" n :: Int
n w :: CfgWeights
w =
CfgWeights
w {backEdgeBonus :: Int
backEdgeBonus = Int
n}
update other :: String
other _ _
= String -> CfgWeights
forall a. String -> a
panic (String -> CfgWeights) -> String -> CfgWeights
forall a b. (a -> b) -> a -> b
$ String
other String -> ShowS
forall a. [a] -> [a] -> [a]
++
" is not a cfg weight parameter. " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
exampleString
settings :: String -> [String]
settings s :: String
s
| (s1 :: String
s1,rest :: 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
== ',') String
s
, String -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null String
rest
= [String
s1]
| (s1 :: String
s1,rest :: 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
== ',') String
s
= [String
s1] [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ String -> [String]
settings (Int -> ShowS
forall a. Int -> [a] -> [a]
drop 1 String
rest)
| Bool
otherwise = String -> [String]
forall a. String -> a
panic (String -> [String]) -> String -> [String]
forall a b. (a -> b) -> a -> b
$ "Invalid cfg parameters." String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
exampleString
assignment :: String -> (String, b)
assignment as :: String
as
| (name :: String
name, _:val :: String
val) <- (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== '=') String
as
= (String
name,String -> b
forall a. Read a => String -> a
read String
val)
| Bool
otherwise
= String -> (String, b)
forall a. String -> a
panic (String -> (String, b)) -> String -> (String, b)
forall a b. (a -> b) -> a -> b
$ "Invalid cfg parameters." String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
exampleString
exampleString :: String
exampleString = "Example parameters: uncondWeight=1000," String -> ShowS
forall a. [a] -> [a] -> [a]
++
"condBranchWeight=800,switchWeight=0,callWeight=300" String -> ShowS
forall a. [a] -> [a] -> [a]
++
",likelyCondWeight=900,unlikelyCondWeight=300" String -> ShowS
forall a. [a] -> [a] -> [a]
++
",infoTablePenalty=300,backEdgeBonus=400"
backendMaintainsCfg :: DynFlags -> Bool
backendMaintainsCfg :: DynFlags -> Bool
backendMaintainsCfg dflags :: DynFlags
dflags = case (Platform -> Arch
platformArch (Platform -> Arch) -> Platform -> Arch
forall a b. (a -> b) -> a -> b
$ DynFlags -> Platform
targetPlatform DynFlags
dflags) of
ArchX86_64 -> Bool
True
_otherwise :: Arch
_otherwise -> Bool
False
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]
}
type LlvmTargets = [(String, LlvmTarget)]
type LlvmPasses = [(Int, String)]
type LlvmConfig = (LlvmTargets, LlvmPasses)
data Settings = Settings {
Settings -> Platform
sTargetPlatform :: Platform,
Settings -> String
sGhcUsagePath :: FilePath,
Settings -> String
sGhciUsagePath :: FilePath,
Settings -> Maybe String
sToolDir :: Maybe FilePath,
Settings -> String
sTopDir :: FilePath,
Settings -> String
sTmpDir :: String,
Settings -> String
sProgramName :: String,
Settings -> String
sProjectVersion :: String,
Settings -> [(String, String)]
sRawSettings :: [(String, String)],
:: [String],
Settings -> String
sSystemPackageConfig :: FilePath,
Settings -> Bool
sLdSupportsCompactUnwind :: Bool,
Settings -> Bool
sLdSupportsBuildId :: Bool,
Settings -> Bool
sLdSupportsFilelist :: Bool,
Settings -> Bool
sLdIsGnuLd :: Bool,
Settings -> Bool
sGccSupportsNoPie :: Bool,
Settings -> String
sPgm_L :: String,
Settings -> (String, [Option])
sPgm_P :: (String,[Option]),
Settings -> String
sPgm_F :: String,
Settings -> (String, [Option])
sPgm_c :: (String,[Option]),
Settings -> (String, [Option])
sPgm_s :: (String,[Option]),
Settings -> (String, [Option])
sPgm_a :: (String,[Option]),
Settings -> (String, [Option])
sPgm_l :: (String,[Option]),
Settings -> (String, [Option])
sPgm_dll :: (String,[Option]),
Settings -> String
sPgm_T :: String,
Settings -> String
sPgm_windres :: String,
Settings -> String
sPgm_libtool :: String,
Settings -> String
sPgm_ar :: String,
Settings -> String
sPgm_ranlib :: String,
Settings -> (String, [Option])
sPgm_lo :: (String,[Option]),
Settings -> (String, [Option])
sPgm_lc :: (String,[Option]),
Settings -> (String, [Option])
sPgm_lcc :: (String,[Option]),
Settings -> String
sPgm_i :: String,
Settings -> [String]
sOpt_L :: [String],
Settings -> [String]
sOpt_P :: [String],
Settings -> Fingerprint
sOpt_P_fingerprint :: Fingerprint,
Settings -> [String]
sOpt_F :: [String],
Settings -> [String]
sOpt_c :: [String],
Settings -> [String]
sOpt_a :: [String],
Settings -> [String]
sOpt_l :: [String],
Settings -> [String]
sOpt_windres :: [String],
Settings -> [String]
sOpt_lo :: [String],
Settings -> [String]
sOpt_lc :: [String],
Settings -> [String]
sOpt_lcc :: [String],
Settings -> [String]
sOpt_i :: [String],
Settings -> PlatformConstants
sPlatformConstants :: PlatformConstants
}
targetPlatform :: DynFlags -> Platform
targetPlatform :: DynFlags -> Platform
targetPlatform dflags :: DynFlags
dflags = Settings -> Platform
sTargetPlatform (DynFlags -> Settings
settings DynFlags
dflags)
programName :: DynFlags -> String
programName :: DynFlags -> String
programName dflags :: DynFlags
dflags = Settings -> String
sProgramName (DynFlags -> Settings
settings DynFlags
dflags)
projectVersion :: DynFlags -> String
projectVersion :: DynFlags -> String
projectVersion dflags :: DynFlags
dflags = Settings -> String
sProjectVersion (DynFlags -> Settings
settings DynFlags
dflags)
ghcUsagePath :: DynFlags -> FilePath
ghcUsagePath :: DynFlags -> String
ghcUsagePath dflags :: DynFlags
dflags = Settings -> String
sGhcUsagePath (DynFlags -> Settings
settings DynFlags
dflags)
ghciUsagePath :: DynFlags -> FilePath
ghciUsagePath :: DynFlags -> String
ghciUsagePath dflags :: DynFlags
dflags = Settings -> String
sGhciUsagePath (DynFlags -> Settings
settings DynFlags
dflags)
toolDir :: DynFlags -> Maybe FilePath
toolDir :: DynFlags -> Maybe String
toolDir dflags :: DynFlags
dflags = Settings -> Maybe String
sToolDir (DynFlags -> Settings
settings DynFlags
dflags)
topDir :: DynFlags -> FilePath
topDir :: DynFlags -> String
topDir dflags :: DynFlags
dflags = Settings -> String
sTopDir (DynFlags -> Settings
settings DynFlags
dflags)
tmpDir :: DynFlags -> String
tmpDir :: DynFlags -> String
tmpDir dflags :: DynFlags
dflags = Settings -> String
sTmpDir (DynFlags -> Settings
settings DynFlags
dflags)
rawSettings :: DynFlags -> [(String, String)]
rawSettings :: DynFlags -> [(String, String)]
rawSettings dflags :: DynFlags
dflags = Settings -> [(String, String)]
sRawSettings (DynFlags -> Settings
settings DynFlags
dflags)
extraGccViaCFlags :: DynFlags -> [String]
dflags :: DynFlags
dflags = Settings -> [String]
sExtraGccViaCFlags (DynFlags -> Settings
settings DynFlags
dflags)
systemPackageConfig :: DynFlags -> FilePath
systemPackageConfig :: DynFlags -> String
systemPackageConfig dflags :: DynFlags
dflags = Settings -> String
sSystemPackageConfig (DynFlags -> Settings
settings DynFlags
dflags)
pgm_L :: DynFlags -> String
pgm_L :: DynFlags -> String
pgm_L dflags :: DynFlags
dflags = Settings -> String
sPgm_L (DynFlags -> Settings
settings DynFlags
dflags)
pgm_P :: DynFlags -> (String,[Option])
pgm_P :: DynFlags -> (String, [Option])
pgm_P dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_P (DynFlags -> Settings
settings DynFlags
dflags)
pgm_F :: DynFlags -> String
pgm_F :: DynFlags -> String
pgm_F dflags :: DynFlags
dflags = Settings -> String
sPgm_F (DynFlags -> Settings
settings DynFlags
dflags)
pgm_c :: DynFlags -> (String,[Option])
pgm_c :: DynFlags -> (String, [Option])
pgm_c dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_c (DynFlags -> Settings
settings DynFlags
dflags)
pgm_s :: DynFlags -> (String,[Option])
pgm_s :: DynFlags -> (String, [Option])
pgm_s dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_s (DynFlags -> Settings
settings DynFlags
dflags)
pgm_a :: DynFlags -> (String,[Option])
pgm_a :: DynFlags -> (String, [Option])
pgm_a dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_a (DynFlags -> Settings
settings DynFlags
dflags)
pgm_l :: DynFlags -> (String,[Option])
pgm_l :: DynFlags -> (String, [Option])
pgm_l dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_l (DynFlags -> Settings
settings DynFlags
dflags)
pgm_dll :: DynFlags -> (String,[Option])
pgm_dll :: DynFlags -> (String, [Option])
pgm_dll dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_dll (DynFlags -> Settings
settings DynFlags
dflags)
pgm_T :: DynFlags -> String
pgm_T :: DynFlags -> String
pgm_T dflags :: DynFlags
dflags = Settings -> String
sPgm_T (DynFlags -> Settings
settings DynFlags
dflags)
pgm_windres :: DynFlags -> String
pgm_windres :: DynFlags -> String
pgm_windres dflags :: DynFlags
dflags = Settings -> String
sPgm_windres (DynFlags -> Settings
settings DynFlags
dflags)
pgm_libtool :: DynFlags -> String
pgm_libtool :: DynFlags -> String
pgm_libtool dflags :: DynFlags
dflags = Settings -> String
sPgm_libtool (DynFlags -> Settings
settings DynFlags
dflags)
pgm_lcc :: DynFlags -> (String,[Option])
pgm_lcc :: DynFlags -> (String, [Option])
pgm_lcc dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_lcc (DynFlags -> Settings
settings DynFlags
dflags)
pgm_ar :: DynFlags -> String
pgm_ar :: DynFlags -> String
pgm_ar dflags :: DynFlags
dflags = Settings -> String
sPgm_ar (DynFlags -> Settings
settings DynFlags
dflags)
pgm_ranlib :: DynFlags -> String
pgm_ranlib :: DynFlags -> String
pgm_ranlib dflags :: DynFlags
dflags = Settings -> String
sPgm_ranlib (DynFlags -> Settings
settings DynFlags
dflags)
pgm_lo :: DynFlags -> (String,[Option])
pgm_lo :: DynFlags -> (String, [Option])
pgm_lo dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_lo (DynFlags -> Settings
settings DynFlags
dflags)
pgm_lc :: DynFlags -> (String,[Option])
pgm_lc :: DynFlags -> (String, [Option])
pgm_lc dflags :: DynFlags
dflags = Settings -> (String, [Option])
sPgm_lc (DynFlags -> Settings
settings DynFlags
dflags)
pgm_i :: DynFlags -> String
pgm_i :: DynFlags -> String
pgm_i dflags :: DynFlags
dflags = Settings -> String
sPgm_i (DynFlags -> Settings
settings DynFlags
dflags)
opt_L :: DynFlags -> [String]
opt_L :: DynFlags -> [String]
opt_L dflags :: DynFlags
dflags = Settings -> [String]
sOpt_L (DynFlags -> Settings
settings DynFlags
dflags)
opt_P :: DynFlags -> [String]
opt_P :: DynFlags -> [String]
opt_P dflags :: DynFlags
dflags = (Way -> [String]) -> [Way] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptP (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> [Way]
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ Settings -> [String]
sOpt_P (DynFlags -> Settings
settings DynFlags
dflags)
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P_signature dflags :: DynFlags
dflags =
( (Way -> [String]) -> [Way] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptP (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> [Way]
ways DynFlags
dflags)
, Settings -> Fingerprint
sOpt_P_fingerprint (DynFlags -> Settings
settings DynFlags
dflags))
opt_F :: DynFlags -> [String]
opt_F :: DynFlags -> [String]
opt_F dflags :: DynFlags
dflags = Settings -> [String]
sOpt_F (DynFlags -> Settings
settings DynFlags
dflags)
opt_c :: DynFlags -> [String]
opt_c :: DynFlags -> [String]
opt_c dflags :: DynFlags
dflags = (Way -> [String]) -> [Way] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptc (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> [Way]
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ Settings -> [String]
sOpt_c (DynFlags -> Settings
settings DynFlags
dflags)
opt_a :: DynFlags -> [String]
opt_a :: DynFlags -> [String]
opt_a dflags :: DynFlags
dflags = Settings -> [String]
sOpt_a (DynFlags -> Settings
settings DynFlags
dflags)
opt_l :: DynFlags -> [String]
opt_l :: DynFlags -> [String]
opt_l dflags :: DynFlags
dflags = (Way -> [String]) -> [Way] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [String]
wayOptl (DynFlags -> Platform
targetPlatform DynFlags
dflags)) (DynFlags -> [Way]
ways DynFlags
dflags)
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ Settings -> [String]
sOpt_l (DynFlags -> Settings
settings DynFlags
dflags)
opt_windres :: DynFlags -> [String]
opt_windres :: DynFlags -> [String]
opt_windres dflags :: DynFlags
dflags = Settings -> [String]
sOpt_windres (DynFlags -> Settings
settings DynFlags
dflags)
opt_lcc :: DynFlags -> [String]
opt_lcc :: DynFlags -> [String]
opt_lcc dflags :: DynFlags
dflags = Settings -> [String]
sOpt_lcc (DynFlags -> Settings
settings DynFlags
dflags)
opt_lo :: DynFlags -> [String]
opt_lo :: DynFlags -> [String]
opt_lo dflags :: DynFlags
dflags = Settings -> [String]
sOpt_lo (DynFlags -> Settings
settings DynFlags
dflags)
opt_lc :: DynFlags -> [String]
opt_lc :: DynFlags -> [String]
opt_lc dflags :: DynFlags
dflags = Settings -> [String]
sOpt_lc (DynFlags -> Settings
settings DynFlags
dflags)
opt_i :: DynFlags -> [String]
opt_i :: DynFlags -> [String]
opt_i dflags :: DynFlags
dflags = Settings -> [String]
sOpt_i (DynFlags -> Settings
settings DynFlags
dflags)
versionedAppDir :: DynFlags -> MaybeT IO FilePath
versionedAppDir :: DynFlags -> MaybeT IO String
versionedAppDir dflags :: DynFlags
dflags = do
String
appdir <- 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 (DynFlags -> String
programName DynFlags
dflags)
String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> MaybeT IO String) -> String -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ String
appdir String -> ShowS
</> DynFlags -> String
versionedFilePath DynFlags
dflags
versionedFilePath :: DynFlags -> FilePath
versionedFilePath :: DynFlags -> String
versionedFilePath dflags :: DynFlags
dflags = TARGET_ARCH
String -> ShowS
forall a. [a] -> [a] -> [a]
++ '-'Char -> ShowS
forall a. a -> [a] -> [a]
:TARGET_OS
String -> ShowS
forall a. [a] -> [a] -> [a]
++ '-'Char -> ShowS
forall a. a -> [a] -> [a]
:DynFlags -> String
projectVersion DynFlags
dflags
data HscTarget
= HscC
| HscAsm
| HscLlvm
| HscInterpreted
| HscNothing
deriving (HscTarget -> HscTarget -> Bool
(HscTarget -> HscTarget -> Bool)
-> (HscTarget -> HscTarget -> Bool) -> Eq HscTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HscTarget -> HscTarget -> Bool
$c/= :: HscTarget -> HscTarget -> Bool
== :: HscTarget -> HscTarget -> Bool
$c== :: HscTarget -> HscTarget -> Bool
Eq, Int -> HscTarget -> ShowS
[HscTarget] -> ShowS
HscTarget -> String
(Int -> HscTarget -> ShowS)
-> (HscTarget -> String)
-> ([HscTarget] -> ShowS)
-> Show HscTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HscTarget] -> ShowS
$cshowList :: [HscTarget] -> ShowS
show :: HscTarget -> String
$cshow :: HscTarget -> String
showsPrec :: Int -> HscTarget -> ShowS
$cshowsPrec :: Int -> HscTarget -> ShowS
Show)
isObjectTarget :: HscTarget -> Bool
isObjectTarget :: HscTarget -> Bool
isObjectTarget HscC = Bool
True
isObjectTarget HscAsm = Bool
True
isObjectTarget HscLlvm = Bool
True
isObjectTarget _ = Bool
False
targetRetainsAllBindings :: HscTarget -> Bool
targetRetainsAllBindings :: HscTarget -> Bool
targetRetainsAllBindings HscInterpreted = Bool
True
targetRetainsAllBindings HscNothing = Bool
True
targetRetainsAllBindings _ = Bool
False
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 CompManager = String -> SDoc
text "CompManager"
ppr OneShot = String -> SDoc
text "OneShot"
ppr MkDepend = String -> SDoc
text "MkDepend"
isOneShot :: GhcMode -> Bool
isOneShot :: GhcMode -> Bool
isOneShot OneShot = Bool
True
isOneShot _other :: GhcMode
_other = Bool
False
data GhcLink
= NoLink
| LinkBinary
| LinkInMemory
| LinkDynLib
| LinkStaticLib
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 NoLink = Bool
True
isNoLink _ = Bool
False
data PackageArg =
PackageArg String
| UnitIdArg UnitId
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 pn :: String
pn) = String -> SDoc
text "package" SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
pn
ppr (UnitIdArg uid :: UnitId
uid) = String -> SDoc
text "unit" SDoc -> SDoc -> SDoc
<+> UnitId -> SDoc
forall a. Outputable a => a -> SDoc
ppr UnitId
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 b :: Bool
b rns :: [(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 PkgConfRef
| 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 idflags1 :: DynFlags
idflags1 idflags0 :: 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 dflags :: 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 n :: String
n arg :: PackageArg
arg rn :: 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 str :: String
str) = String -> SDoc
text "-hide-package" SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
str
defaultHscTarget :: Platform -> HscTarget
defaultHscTarget :: Platform -> HscTarget
defaultHscTarget = Platform -> HscTarget
defaultObjectTarget
defaultObjectTarget :: Platform -> HscTarget
defaultObjectTarget :: Platform -> HscTarget
defaultObjectTarget platform :: Platform
platform
| Platform -> Bool
platformUnregisterised Platform
platform = HscTarget
HscC
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES" = HscTarget
HscAsm
| Bool
otherwise = HscTarget
HscLlvm
tablesNextToCode :: DynFlags -> Bool
tablesNextToCode :: DynFlags -> Bool
tablesNextToCode dflags :: DynFlags
dflags
= Bool -> Bool
mkTablesNextToCode (Platform -> Bool
platformUnregisterised (DynFlags -> Platform
targetPlatform DynFlags
dflags))
mkTablesNextToCode :: Bool -> Bool
mkTablesNextToCode :: Bool -> Bool
mkTablesNextToCode unregisterised :: Bool
unregisterised
= Bool -> Bool
not Bool
unregisterised Bool -> Bool -> Bool
&& String
cGhcEnableTablesNextToCode String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
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)
shouldUseColor :: DynFlags -> Bool
shouldUseColor :: DynFlags -> Bool
shouldUseColor dflags :: DynFlags
dflags = Bool -> OverridingBool -> Bool
overrideWith (DynFlags -> Bool
canUseColor DynFlags
dflags) (DynFlags -> OverridingBool
useColor DynFlags
dflags)
shouldUseHexWordLiterals :: DynFlags -> Bool
shouldUseHexWordLiterals :: DynFlags -> Bool
shouldUseHexWordLiterals dflags :: DynFlags
dflags =
GeneralFlag
Opt_HexWordLiterals GeneralFlag -> EnumSet GeneralFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` DynFlags -> EnumSet GeneralFlag
generalFlags DynFlags
dflags
positionIndependent :: DynFlags -> Bool
positionIndependent :: DynFlags -> Bool
positionIndependent dflags :: DynFlags
dflags = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags Bool -> Bool -> Bool
|| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIE DynFlags
dflags
data Way
= WayCustom String
| WayThreaded
| WayDebug
| WayProf
| WayEventLog
| WayDyn
deriving (Way -> Way -> Bool
(Way -> Way -> Bool) -> (Way -> Way -> Bool) -> Eq Way
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Way -> Way -> Bool
$c/= :: Way -> Way -> Bool
== :: Way -> Way -> Bool
$c== :: Way -> Way -> Bool
Eq, Eq Way
Eq Way =>
(Way -> Way -> Ordering)
-> (Way -> Way -> Bool)
-> (Way -> Way -> Bool)
-> (Way -> Way -> Bool)
-> (Way -> Way -> Bool)
-> (Way -> Way -> Way)
-> (Way -> Way -> Way)
-> Ord Way
Way -> Way -> Bool
Way -> Way -> Ordering
Way -> Way -> Way
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 :: Way -> Way -> Way
$cmin :: Way -> Way -> Way
max :: Way -> Way -> Way
$cmax :: Way -> Way -> Way
>= :: Way -> Way -> Bool
$c>= :: Way -> Way -> Bool
> :: Way -> Way -> Bool
$c> :: Way -> Way -> Bool
<= :: Way -> Way -> Bool
$c<= :: Way -> Way -> Bool
< :: Way -> Way -> Bool
$c< :: Way -> Way -> Bool
compare :: Way -> Way -> Ordering
$ccompare :: Way -> Way -> Ordering
$cp1Ord :: Eq Way
Ord, Int -> Way -> ShowS
[Way] -> ShowS
Way -> String
(Int -> Way -> ShowS)
-> (Way -> String) -> ([Way] -> ShowS) -> Show Way
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Way] -> ShowS
$cshowList :: [Way] -> ShowS
show :: Way -> String
$cshow :: Way -> String
showsPrec :: Int -> Way -> ShowS
$cshowsPrec :: Int -> Way -> ShowS
Show)
allowed_combination :: [Way] -> Bool
allowed_combination :: [Way] -> Bool
allowed_combination way :: [Way]
way = [Bool] -> Bool
forall (t :: * -> *). Foldable t => t Bool -> Bool
and [ Way
x Way -> Way -> Bool
`allowedWith` Way
y
| Way
x <- [Way]
way, Way
y <- [Way]
way, Way
x Way -> Way -> Bool
forall a. Ord a => a -> a -> Bool
< Way
y ]
where
_ allowedWith :: Way -> Way -> Bool
`allowedWith` WayDyn = Bool
True
WayDyn `allowedWith` _ = Bool
True
_ `allowedWith` WayDebug = Bool
True
WayDebug `allowedWith` _ = Bool
True
(WayCustom {}) `allowedWith` _ = Bool
True
WayThreaded `allowedWith` WayProf = Bool
True
WayThreaded `allowedWith` WayEventLog = Bool
True
WayProf `allowedWith` WayEventLog = Bool
True
_ `allowedWith` _ = Bool
False
mkBuildTag :: [Way] -> String
mkBuildTag :: [Way] -> String
mkBuildTag ways :: [Way]
ways = [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (String -> [String] -> [String]
forall a. a -> [a] -> [a]
intersperse "_" ((Way -> String) -> [Way] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Way -> String
wayTag [Way]
ways))
wayTag :: Way -> String
wayTag :: Way -> String
wayTag (WayCustom xs :: String
xs) = String
xs
wayTag WayThreaded = "thr"
wayTag WayDebug = "debug"
wayTag WayDyn = "dyn"
wayTag WayProf = "p"
wayTag WayEventLog = "l"
wayRTSOnly :: Way -> Bool
wayRTSOnly :: Way -> Bool
wayRTSOnly (WayCustom {}) = Bool
False
wayRTSOnly WayThreaded = Bool
True
wayRTSOnly WayDebug = Bool
True
wayRTSOnly WayDyn = Bool
False
wayRTSOnly WayProf = Bool
False
wayRTSOnly WayEventLog = Bool
True
wayDesc :: Way -> String
wayDesc :: Way -> String
wayDesc (WayCustom xs :: String
xs) = String
xs
wayDesc WayThreaded = "Threaded"
wayDesc WayDebug = "Debug"
wayDesc WayDyn = "Dynamic"
wayDesc WayProf = "Profiling"
wayDesc WayEventLog = "RTS Event Logging"
wayGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayGeneralFlags _ (WayCustom {}) = []
wayGeneralFlags _ WayThreaded = []
wayGeneralFlags _ WayDebug = []
wayGeneralFlags _ WayDyn = [GeneralFlag
Opt_PIC, GeneralFlag
Opt_ExternalDynamicRefs]
wayGeneralFlags _ WayProf = [GeneralFlag
Opt_SccProfilingOn]
wayGeneralFlags _ WayEventLog = []
wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags _ (WayCustom {}) = []
wayUnsetGeneralFlags _ WayThreaded = []
wayUnsetGeneralFlags _ WayDebug = []
wayUnsetGeneralFlags _ WayDyn = [
GeneralFlag
Opt_SplitObjs,
GeneralFlag
Opt_SplitSections]
wayUnsetGeneralFlags _ WayProf = []
wayUnsetGeneralFlags _ WayEventLog = []
wayOptc :: Platform -> Way -> [String]
wayOptc :: Platform -> Way -> [String]
wayOptc _ (WayCustom {}) = []
wayOptc platform :: Platform
platform WayThreaded = case Platform -> OS
platformOS Platform
platform of
OSOpenBSD -> ["-pthread"]
OSNetBSD -> ["-pthread"]
_ -> []
wayOptc _ WayDebug = []
wayOptc _ WayDyn = []
wayOptc _ WayProf = ["-DPROFILING"]
wayOptc _ WayEventLog = ["-DTRACING"]
wayOptl :: Platform -> Way -> [String]
wayOptl :: Platform -> Way -> [String]
wayOptl _ (WayCustom {}) = []
wayOptl platform :: Platform
platform WayThreaded =
case Platform -> OS
platformOS Platform
platform of
OSFreeBSD -> ["-pthread"]
OSOpenBSD -> ["-pthread"]
OSNetBSD -> ["-pthread"]
_ -> []
wayOptl _ WayDebug = []
wayOptl _ WayDyn = []
wayOptl _ WayProf = []
wayOptl _ WayEventLog = []
wayOptP :: Platform -> Way -> [String]
wayOptP :: Platform -> Way -> [String]
wayOptP _ (WayCustom {}) = []
wayOptP _ WayThreaded = []
wayOptP _ WayDebug = []
wayOptP _ WayDyn = []
wayOptP _ WayProf = ["-DPROFILING"]
wayOptP _ WayEventLog = ["-DTRACING"]
whenGeneratingDynamicToo :: MonadIO m => DynFlags -> m () -> m ()
whenGeneratingDynamicToo :: DynFlags -> m () -> m ()
whenGeneratingDynamicToo dflags :: DynFlags
dflags f :: m ()
f = DynFlags -> m () -> m () -> m ()
forall (m :: * -> *) a. MonadIO m => DynFlags -> m a -> m a -> m a
ifGeneratingDynamicToo DynFlags
dflags m ()
f (() -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ())
ifGeneratingDynamicToo :: MonadIO m => DynFlags -> m a -> m a -> m a
ifGeneratingDynamicToo :: DynFlags -> m a -> m a -> m a
ifGeneratingDynamicToo dflags :: DynFlags
dflags f :: m a
f g :: m a
g = DynFlags -> m a -> m a -> m a -> m a
forall (m :: * -> *) a.
MonadIO m =>
DynFlags -> m a -> m a -> m a -> m a
generateDynamicTooConditional DynFlags
dflags m a
f m a
g m a
g
whenCannotGenerateDynamicToo :: MonadIO m => DynFlags -> m () -> m ()
whenCannotGenerateDynamicToo :: DynFlags -> m () -> m ()
whenCannotGenerateDynamicToo dflags :: DynFlags
dflags f :: m ()
f
= DynFlags -> m () -> m () -> m ()
forall (m :: * -> *) a. MonadIO m => DynFlags -> m a -> m a -> m a
ifCannotGenerateDynamicToo DynFlags
dflags m ()
f (() -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ())
ifCannotGenerateDynamicToo :: MonadIO m => DynFlags -> m a -> m a -> m a
ifCannotGenerateDynamicToo :: DynFlags -> m a -> m a -> m a
ifCannotGenerateDynamicToo dflags :: DynFlags
dflags f :: m a
f g :: m a
g
= DynFlags -> m a -> m a -> m a -> m a
forall (m :: * -> *) a.
MonadIO m =>
DynFlags -> m a -> m a -> m a -> m a
generateDynamicTooConditional DynFlags
dflags m a
g m a
f m a
g
generateDynamicTooConditional :: MonadIO m
=> DynFlags -> m a -> m a -> m a -> m a
generateDynamicTooConditional :: DynFlags -> m a -> m a -> m a -> m a
generateDynamicTooConditional dflags :: DynFlags
dflags canGen :: m a
canGen cannotGen :: m a
cannotGen notTryingToGen :: m a
notTryingToGen
= if GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_BuildDynamicToo DynFlags
dflags
then do let ref :: IORef Bool
ref = DynFlags -> IORef Bool
canGenerateDynamicToo DynFlags
dflags
Bool
b <- IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ IORef Bool -> IO Bool
forall a. IORef a -> IO a
readIORef IORef Bool
ref
if Bool
b then m a
canGen else m a
cannotGen
else m a
notTryingToGen
dynamicTooMkDynamicDynFlags :: DynFlags -> DynFlags
dynamicTooMkDynamicDynFlags :: DynFlags -> DynFlags
dynamicTooMkDynamicDynFlags dflags0 :: DynFlags
dflags0
= let dflags1 :: DynFlags
dflags1 = Way -> DynFlags -> DynFlags
addWay' Way
WayDyn DynFlags
dflags0
dflags2 :: DynFlags
dflags2 = DynFlags
dflags1 {
outputFile :: Maybe String
outputFile = DynFlags -> Maybe String
dynOutputFile DynFlags
dflags1,
hiSuf :: String
hiSuf = DynFlags -> String
dynHiSuf DynFlags
dflags1,
objectSuf :: String
objectSuf = DynFlags -> String
dynObjectSuf DynFlags
dflags1
}
dflags3 :: DynFlags
dflags3 = DynFlags -> DynFlags
updateWays DynFlags
dflags2
dflags4 :: DynFlags
dflags4 = DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags3 GeneralFlag
Opt_BuildDynamicToo
in DynFlags
dflags4
initDynFlags :: DynFlags -> IO DynFlags
initDynFlags :: DynFlags -> IO DynFlags
initDynFlags dflags :: DynFlags
dflags = do
let
platformCanGenerateDynamicToo :: Bool
platformCanGenerateDynamicToo
= Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags) OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
/= OS
OSMinGW32
IORef Bool
refCanGenerateDynamicToo <- Bool -> IO (IORef Bool)
forall a. a -> IO (IORef a)
newIORef Bool
platformCanGenerateDynamicToo
IORef Int
refNextTempSuffix <- Int -> IO (IORef Int)
forall a. a -> IO (IORef a)
newIORef 0
IORef FilesToClean
refFilesToClean <- FilesToClean -> IO (IORef FilesToClean)
forall a. a -> IO (IORef a)
newIORef FilesToClean
emptyFilesToClean
IORef (Map String String)
refDirsToClean <- Map String String -> IO (IORef (Map String String))
forall a. a -> IO (IORef a)
newIORef Map String String
forall k a. Map k a
Map.empty
IORef (Set String)
refGeneratedDumps <- Set String -> IO (IORef (Set String))
forall a. a -> IO (IORef a)
newIORef Set String
forall a. Set a
Set.empty
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 (ModuleEnv Int)
wrapperNum <- ModuleEnv Int -> IO (IORef (ModuleEnv Int))
forall a. a -> IO (IORef a)
newIORef ModuleEnv Int
forall a. ModuleEnv a
emptyModuleEnv
Bool
canUseUnicode <- do let enc :: TextEncoding
enc = TextEncoding
localeEncoding
str :: String
str = "‘’"
(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
$ \cstr :: 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` \_ -> Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False
Bool
canUseColor <- IO Bool
stderrSupportsAnsiColors
Maybe String
maybeGhcColorsEnv <- String -> IO (Maybe String)
lookupEnv "GHC_COLORS"
Maybe String
maybeGhcColoursEnv <- String -> IO (Maybe String)
lookupEnv "GHC_COLOURS"
let adjustCols :: Maybe String
-> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
adjustCols (Just env :: String
env) = String -> (OverridingBool, Scheme) -> (OverridingBool, Scheme)
Col.parseScheme String
env
adjustCols Nothing = (OverridingBool, Scheme) -> (OverridingBool, Scheme)
forall a. a -> a
id
let (useColor' :: OverridingBool
useColor', colScheme' :: 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)
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags{
canGenerateDynamicToo :: IORef Bool
canGenerateDynamicToo = IORef Bool
refCanGenerateDynamicToo,
nextTempSuffix :: IORef Int
nextTempSuffix = IORef Int
refNextTempSuffix,
filesToClean :: IORef FilesToClean
filesToClean = IORef FilesToClean
refFilesToClean,
dirsToClean :: IORef (Map String String)
dirsToClean = IORef (Map String String)
refDirsToClean,
generatedDumps :: IORef (Set String)
generatedDumps = IORef (Set String)
refGeneratedDumps,
nextWrapperNum :: IORef (ModuleEnv Int)
nextWrapperNum = IORef (ModuleEnv Int)
wrapperNum,
useUnicode :: Bool
useUnicode = Bool
canUseUnicode,
useColor :: OverridingBool
useColor = OverridingBool
useColor',
canUseColor :: Bool
canUseColor = Bool
canUseColor,
colScheme :: Scheme
colScheme = Scheme
colScheme',
rtldInfo :: IORef (Maybe LinkerInfo)
rtldInfo = IORef (Maybe LinkerInfo)
refRtldInfo,
rtccInfo :: IORef (Maybe CompilerInfo)
rtccInfo = IORef (Maybe CompilerInfo)
refRtccInfo
}
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags
defaultDynFlags mySettings :: Settings
mySettings (myLlvmTargets :: LlvmTargets
myLlvmTargets, myLlvmPasses :: LlvmPasses
myLlvmPasses) =
DynFlags :: GhcMode
-> GhcLink
-> HscTarget
-> Settings
-> IntegerLibrary
-> LlvmTargets
-> LlvmPasses
-> Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> Maybe String
-> Maybe String
-> [Int]
-> Maybe Int
-> Bool
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Int
-> Int
-> Maybe Int
-> Maybe Int
-> Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Bool
-> Maybe Int
-> Int
-> [String]
-> Module
-> Maybe String
-> IntWithInf
-> IntWithInf
-> InstalledUnitId
-> Maybe ComponentId
-> Maybe [(ModuleName, Module)]
-> [Way]
-> String
-> Maybe (String, Int)
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> String
-> String
-> String
-> String
-> IORef Bool
-> String
-> String
-> Maybe String
-> Maybe String
-> Maybe String
-> DynLibLoader
-> Maybe String
-> Maybe String
-> [Option]
-> IncludeSpecs
-> [String]
-> [String]
-> [String]
-> Maybe String
-> RtsOptsEnabled
-> Bool
-> String
-> [ModuleName]
-> [(ModuleName, String)]
-> [String]
-> [LoadedPlugin]
-> [StaticPlugin]
-> Hooks
-> String
-> Bool
-> [ModuleName]
-> [String]
-> [PackageDBFlag]
-> [IgnorePackageFlag]
-> [PackageFlag]
-> [PackageFlag]
-> [TrustFlag]
-> Maybe String
-> Maybe [(String, [PackageConfig])]
-> PackageState
-> IORef FilesToClean
-> IORef (Map String String)
-> IORef Int
-> IORef (Set String)
-> EnumSet DumpFlag
-> EnumSet GeneralFlag
-> EnumSet WarningFlag
-> EnumSet WarningFlag
-> Maybe Language
-> SafeHaskellMode
-> Bool
-> Bool
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> SrcSpan
-> [OnOff Extension]
-> EnumSet Extension
-> Int
-> Int
-> Int
-> Int
-> Float
-> Int
-> Bool
-> Int
-> Int
-> LogAction
-> FlushOut
-> FlushErr
-> Maybe String
-> Maybe String
-> [String]
-> Int
-> Int
-> Bool
-> OverridingBool
-> Bool
-> Scheme
-> ProfAuto
-> Maybe String
-> IORef (ModuleEnv Int)
-> Maybe SseVersion
-> Maybe BmiVersion
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> IORef (Maybe LinkerInfo)
-> IORef (Maybe CompilerInfo)
-> Int
-> Int
-> Int
-> Bool
-> Maybe Int
-> Int
-> Int
-> CfgWeights
-> DynFlags
DynFlags {
ghcMode :: GhcMode
ghcMode = GhcMode
CompManager,
ghcLink :: GhcLink
ghcLink = GhcLink
LinkBinary,
hscTarget :: HscTarget
hscTarget = Platform -> HscTarget
defaultHscTarget (Settings -> Platform
sTargetPlatform Settings
mySettings),
integerLibrary :: IntegerLibrary
integerLibrary = IntegerLibrary
cIntegerLibraryType,
verbosity :: Int
verbosity = 0,
optLevel :: Int
optLevel = 0,
debugLevel :: Int
debugLevel = 0,
simplPhases :: Int
simplPhases = 2,
maxSimplIterations :: Int
maxSimplIterations = 4,
maxPmCheckIterations :: Int
maxPmCheckIterations = 2000000,
ruleCheck :: Maybe String
ruleCheck = Maybe String
forall a. Maybe a
Nothing,
inlineCheck :: Maybe String
inlineCheck = Maybe String
forall a. Maybe a
Nothing,
maxRelevantBinds :: Maybe Int
maxRelevantBinds = Int -> Maybe Int
forall a. a -> Maybe a
Just 6,
maxValidHoleFits :: Maybe Int
maxValidHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just 6,
maxRefHoleFits :: Maybe Int
maxRefHoleFits = Int -> Maybe Int
forall a. a -> Maybe a
Just 6,
refLevelHoleFits :: Maybe Int
refLevelHoleFits = Maybe Int
forall a. Maybe a
Nothing,
maxUncoveredPatterns :: Int
maxUncoveredPatterns = 4,
simplTickFactor :: Int
simplTickFactor = 100,
specConstrThreshold :: Maybe Int
specConstrThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just 2000,
specConstrCount :: Maybe Int
specConstrCount = Int -> Maybe Int
forall a. a -> Maybe a
Just 3,
specConstrRecursive :: Int
specConstrRecursive = 3,
liberateCaseThreshold :: Maybe Int
liberateCaseThreshold = Int -> Maybe Int
forall a. a -> Maybe a
Just 2000,
floatLamArgs :: Maybe Int
floatLamArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just 0,
liftLamsRecArgs :: Maybe Int
liftLamsRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just 5,
liftLamsNonRecArgs :: Maybe Int
liftLamsNonRecArgs = Int -> Maybe Int
forall a. a -> Maybe a
Just 5,
liftLamsKnown :: Bool
liftLamsKnown = Bool
False,
cmmProcAlignment :: Maybe Int
cmmProcAlignment = Maybe Int
forall a. Maybe a
Nothing,
historySize :: Int
historySize = 20,
strictnessBefore :: [Int]
strictnessBefore = [],
parMakeCount :: Maybe Int
parMakeCount = Int -> Maybe Int
forall a. a -> Maybe a
Just 1,
enableTimeStats :: Bool
enableTimeStats = Bool
False,
ghcHeapSize :: Maybe Int
ghcHeapSize = Maybe Int
forall a. Maybe a
Nothing,
importPaths :: [String]
importPaths = ["."],
mainModIs :: Module
mainModIs = Module
mAIN,
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,
thisInstalledUnitId :: InstalledUnitId
thisInstalledUnitId = UnitId -> InstalledUnitId
toInstalledUnitId UnitId
mainUnitId,
thisUnitIdInsts_ :: Maybe [(ModuleName, Module)]
thisUnitIdInsts_ = Maybe [(ModuleName, Module)]
forall a. Maybe a
Nothing,
thisComponentId_ :: Maybe ComponentId
thisComponentId_ = Maybe ComponentId
forall a. Maybe a
Nothing,
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 = "hi",
hieSuf :: String
hieSuf = "hie",
canGenerateDynamicToo :: IORef Bool
canGenerateDynamicToo = String -> IORef Bool
forall a. String -> a
panic "defaultDynFlags: No canGenerateDynamicToo",
dynObjectSuf :: String
dynObjectSuf = "dyn_" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Phase -> String
phaseInputExt Phase
StopLn,
dynHiSuf :: String
dynHiSuf = "dyn_hi",
pluginModNames :: [ModuleName]
pluginModNames = [],
pluginModNameOpts :: [(ModuleName, String)]
pluginModNameOpts = [],
frontendPluginOpts :: [String]
frontendPluginOpts = [],
cachedPlugins :: [LoadedPlugin]
cachedPlugins = [],
staticPlugins :: [StaticPlugin]
staticPlugins = [],
hooks :: Hooks
hooks = Hooks
emptyHooks,
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,
dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
SystemDependent,
dumpPrefix :: Maybe String
dumpPrefix = Maybe String
forall a. Maybe a
Nothing,
dumpPrefixForce :: Maybe String
dumpPrefixForce = Maybe String
forall a. Maybe a
Nothing,
ldInputs :: [Option]
ldInputs = [],
includePaths :: IncludeSpecs
includePaths = [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 = ".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,
pkgDatabase :: Maybe [(String, [PackageConfig])]
pkgDatabase = Maybe [(String, [PackageConfig])]
forall a. Maybe a
Nothing,
pkgState :: PackageState
pkgState = PackageState
emptyPackageState,
ways :: [Way]
ways = Settings -> [Way]
defaultWays Settings
mySettings,
buildTag :: String
buildTag = [Way] -> String
mkBuildTag (Settings -> [Way]
defaultWays Settings
mySettings),
splitInfo :: Maybe (String, Int)
splitInfo = Maybe (String, Int)
forall a. Maybe a
Nothing,
settings :: Settings
settings = Settings
mySettings,
llvmTargets :: LlvmTargets
llvmTargets = LlvmTargets
myLlvmTargets,
llvmPasses :: LlvmPasses
llvmPasses = LlvmPasses
myLlvmPasses,
depMakefile :: String
depMakefile = "Makefile",
depIncludePkgDeps :: Bool
depIncludePkgDeps = Bool
False,
depExcludeMods :: [ModuleName]
depExcludeMods = [],
depSuffixes :: [String]
depSuffixes = [],
nextTempSuffix :: IORef Int
nextTempSuffix = String -> IORef Int
forall a. String -> a
panic "defaultDynFlags: No nextTempSuffix",
filesToClean :: IORef FilesToClean
filesToClean = String -> IORef FilesToClean
forall a. String -> a
panic "defaultDynFlags: No filesToClean",
dirsToClean :: IORef (Map String String)
dirsToClean = String -> IORef (Map String String)
forall a. String -> a
panic "defaultDynFlags: No dirsToClean",
generatedDumps :: IORef (Set String)
generatedDumps = String -> IORef (Set String)
forall a. String -> a
panic "defaultDynFlags: No generatedDumps",
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,
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 [],
ufCreationThreshold :: Int
ufCreationThreshold = 750,
ufUseThreshold :: Int
ufUseThreshold = 60,
ufFunAppDiscount :: Int
ufFunAppDiscount = 60,
ufDictDiscount :: Int
ufDictDiscount = 30,
ufKeenessFactor :: Float
ufKeenessFactor = 1.5,
ufDearOp :: Int
ufDearOp = 40,
ufVeryAggressive :: Bool
ufVeryAggressive = Bool
False,
maxWorkerArgs :: Int
maxWorkerArgs = 10,
ghciHistSize :: Int
ghciHistSize = 50,
log_action :: LogAction
log_action = LogAction
defaultLogAction,
flushOut :: FlushOut
flushOut = FlushOut
defaultFlushOut,
flushErr :: FlushErr
flushErr = FlushErr
defaultFlushErr,
pprUserLength :: Int
pprUserLength = 5,
pprCols :: Int
pprCols = 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,
interactivePrint :: Maybe String
interactivePrint = Maybe String
forall a. Maybe a
Nothing,
nextWrapperNum :: IORef (ModuleEnv Int)
nextWrapperNum = String -> IORef (ModuleEnv Int)
forall a. String -> a
panic "defaultDynFlags: No nextWrapperNum",
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 "defaultDynFlags: no rtldInfo",
rtccInfo :: IORef (Maybe CompilerInfo)
rtccInfo = String -> IORef (Maybe CompilerInfo)
forall a. String -> a
panic "defaultDynFlags: no rtccInfo",
maxInlineAllocSize :: Int
maxInlineAllocSize = 128,
maxInlineMemcpyInsns :: Int
maxInlineMemcpyInsns = 32,
maxInlineMemsetInsns :: Int
maxInlineMemsetInsns = 32,
initialUnique :: Int
initialUnique = 0,
uniqueIncrement :: Int
uniqueIncrement = 1,
reverseErrors :: Bool
reverseErrors = Bool
False,
maxErrors :: Maybe Int
maxErrors = Maybe Int
forall a. Maybe a
Nothing,
cfgWeightInfo :: CfgWeights
cfgWeightInfo = CfgWeights
defaultCfgWeights
}
defaultWays :: Settings -> [Way]
defaultWays :: Settings -> [Way]
defaultWays settings :: Settings
settings = if PlatformConstants -> Bool
pc_DYNAMIC_BY_DEFAULT (Settings -> PlatformConstants
sPlatformConstants Settings
settings)
then [Way
WayDyn]
else []
interpWays :: [Way]
interpWays :: [Way]
interpWays
| Bool
dynamicGhc = [Way
WayDyn]
| Bool
rtsIsProfiled = [Way
WayProf]
| Bool
otherwise = []
interpreterProfiled :: DynFlags -> Bool
interpreterProfiled :: DynFlags -> Bool
interpreterProfiled dflags :: DynFlags
dflags
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalInterpreter DynFlags
dflags = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SccProfilingOn DynFlags
dflags
| Bool
otherwise = Bool
rtsIsProfiled
interpreterDynamic :: DynFlags -> Bool
interpreterDynamic :: DynFlags -> Bool
interpreterDynamic dflags :: DynFlags
dflags
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalInterpreter DynFlags
dflags = Way
WayDyn Way -> [Way] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` DynFlags -> [Way]
ways DynFlags
dflags
| Bool
otherwise = Bool
dynamicGhc
type FatalMessager = String -> IO ()
type LogAction = DynFlags
-> WarnReason
-> Severity
-> SrcSpan
-> PprStyle
-> MsgDoc
-> IO ()
defaultFatalMessager :: FatalMessager
defaultFatalMessager :: FatalMessager
defaultFatalMessager = Handle -> FatalMessager
hPutStrLn Handle
stderr
jsonLogAction :: LogAction
jsonLogAction :: LogAction
jsonLogAction dflags :: DynFlags
dflags reason :: WarnReason
reason severity :: Severity
severity srcSpan :: SrcSpan
srcSpan _style :: PprStyle
_style msg :: SDoc
msg
= do
DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPutStrDoc DynFlags
dflags Handle
stdout (SDoc
doc SDoc -> SDoc -> SDoc
$$ String -> SDoc
text "")
(CodeStyle -> PprStyle
mkCodeStyle CodeStyle
CStyle)
where
doc :: SDoc
doc = JsonDoc -> SDoc
renderJSON (JsonDoc -> SDoc) -> JsonDoc -> SDoc
forall a b. (a -> b) -> a -> b
$
[(String, JsonDoc)] -> JsonDoc
JSObject [ ( "span", SrcSpan -> JsonDoc
forall a. ToJson a => a -> JsonDoc
json SrcSpan
srcSpan )
, ( "doc" , String -> JsonDoc
JSString (DynFlags -> SDoc -> String
showSDoc DynFlags
dflags SDoc
msg) )
, ( "severity", Severity -> JsonDoc
forall a. ToJson a => a -> JsonDoc
json Severity
severity )
, ( "reason" , WarnReason -> JsonDoc
forall a. ToJson a => a -> JsonDoc
json WarnReason
reason )
]
defaultLogAction :: LogAction
defaultLogAction :: LogAction
defaultLogAction dflags :: DynFlags
dflags reason :: WarnReason
reason severity :: Severity
severity srcSpan :: SrcSpan
srcSpan style :: PprStyle
style msg :: SDoc
msg
= case Severity
severity of
SevOutput -> SDoc -> PprStyle -> IO ()
printOut SDoc
msg PprStyle
style
SevDump -> SDoc -> PprStyle -> IO ()
printOut (SDoc
msg SDoc -> SDoc -> SDoc
$$ SDoc
blankLine) PprStyle
style
SevInteractive -> SDoc -> PprStyle -> IO ()
putStrSDoc SDoc
msg PprStyle
style
SevInfo -> SDoc -> PprStyle -> IO ()
printErrs SDoc
msg PprStyle
style
SevFatal -> SDoc -> PprStyle -> IO ()
printErrs SDoc
msg PprStyle
style
SevWarning -> IO ()
printWarns
SevError -> IO ()
printWarns
where
printOut :: SDoc -> PprStyle -> IO ()
printOut = DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPrintDoc DynFlags
dflags Handle
stdout
printErrs :: SDoc -> PprStyle -> IO ()
printErrs = DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPrintDoc DynFlags
dflags Handle
stderr
putStrSDoc :: SDoc -> PprStyle -> IO ()
putStrSDoc = DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPutStrDoc DynFlags
dflags Handle
stdout
message :: SDoc
message = Maybe String -> Severity -> SrcSpan -> SDoc -> SDoc
mkLocMessageAnn Maybe String
flagMsg Severity
severity SrcSpan
srcSpan SDoc
msg
printWarns :: IO ()
printWarns = do
Handle -> Char -> IO ()
hPutChar Handle
stderr '\n'
SDoc
caretDiagnostic <-
if GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_DiagnosticsShowCaret DynFlags
dflags
then Severity -> SrcSpan -> IO SDoc
getCaretDiagnostic Severity
severity SrcSpan
srcSpan
else SDoc -> IO SDoc
forall (f :: * -> *) a. Applicative f => a -> f a
pure SDoc
empty
SDoc -> PprStyle -> IO ()
printErrs (SDoc
message SDoc -> SDoc -> SDoc
$+$ SDoc
caretDiagnostic)
(Bool -> PprStyle -> PprStyle
setStyleColoured Bool
True PprStyle
style)
flagMsg :: Maybe String
flagMsg =
case WarnReason
reason of
NoReason -> Maybe String
forall a. Maybe a
Nothing
Reason wflag :: WarningFlag
wflag -> do
FlagSpec WarningFlag
spec <- WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf WarningFlag
wflag
String -> Maybe String
forall (m :: * -> *) a. Monad m => a -> m a
return ("-W" String -> ShowS
forall a. [a] -> [a] -> [a]
++ FlagSpec WarningFlag -> String
forall flag. FlagSpec flag -> String
flagSpecName FlagSpec WarningFlag
spec String -> ShowS
forall a. [a] -> [a] -> [a]
++ WarningFlag -> String
warnFlagGrp WarningFlag
wflag)
ErrReason Nothing ->
String -> Maybe String
forall (m :: * -> *) a. Monad m => a -> m a
return "-Werror"
ErrReason (Just wflag :: WarningFlag
wflag) -> do
FlagSpec WarningFlag
spec <- WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf WarningFlag
wflag
String -> Maybe String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> Maybe String) -> String -> Maybe String
forall a b. (a -> b) -> a -> b
$
"-W" String -> ShowS
forall a. [a] -> [a] -> [a]
++ FlagSpec WarningFlag -> String
forall flag. FlagSpec flag -> String
flagSpecName FlagSpec WarningFlag
spec String -> ShowS
forall a. [a] -> [a] -> [a]
++ WarningFlag -> String
warnFlagGrp WarningFlag
wflag String -> ShowS
forall a. [a] -> [a] -> [a]
++
", -Werror=" String -> ShowS
forall a. [a] -> [a] -> [a]
++ FlagSpec WarningFlag -> String
forall flag. FlagSpec flag -> String
flagSpecName FlagSpec WarningFlag
spec
warnFlagGrp :: WarningFlag -> String
warnFlagGrp flag :: WarningFlag
flag
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ShowWarnGroups DynFlags
dflags =
case WarningFlag -> [String]
smallestGroups WarningFlag
flag of
[] -> ""
groups :: [String]
groups -> " (in " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate ", " (ShowS -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map ("-W"String -> ShowS
forall a. [a] -> [a] -> [a]
++) [String]
groups) String -> ShowS
forall a. [a] -> [a] -> [a]
++ ")"
| Bool
otherwise = ""
defaultLogActionHPrintDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPrintDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPrintDoc dflags :: DynFlags
dflags h :: Handle
h d :: SDoc
d sty :: PprStyle
sty
= DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPutStrDoc DynFlags
dflags Handle
h (SDoc
d SDoc -> SDoc -> SDoc
$$ String -> SDoc
text "") PprStyle
sty
defaultLogActionHPutStrDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPutStrDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogActionHPutStrDoc dflags :: DynFlags
dflags h :: Handle
h d :: SDoc
d sty :: PprStyle
sty
= Mode -> DynFlags -> Handle -> PprStyle -> SDoc -> IO ()
printSDoc Mode
Pretty.PageMode DynFlags
dflags Handle
h PprStyle
sty SDoc
d
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
newtype FlushErr = FlushErr (IO ())
defaultFlushErr :: FlushErr
defaultFlushErr :: FlushErr
defaultFlushErr = IO () -> FlushErr
FlushErr (IO () -> FlushErr) -> IO () -> FlushErr
forall a b. (a -> b) -> a -> b
$ Handle -> IO ()
hFlush Handle
stderr
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 x :: a
x) = String -> SDoc
text "On" SDoc -> SDoc -> SDoc
<+> a -> SDoc
forall a. Outputable a => a -> SDoc
ppr a
x
ppr (Off x :: a
x) = String -> SDoc
text "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 ml :: 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 f :: a
f) flags :: 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 f :: a
f) flags :: 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 Nothing
= Extension
LangExt.NondecreasingIndentation
Extension -> [Extension] -> [Extension]
forall a. a -> [a] -> [a]
: Extension -> [Extension] -> [Extension]
forall a. Eq a => a -> [a] -> [a]
delete Extension
LangExt.DatatypeContexts
(Maybe Language -> [Extension]
languageExtensions (Language -> Maybe Language
forall a. a -> Maybe a
Just Language
Haskell2010))
languageExtensions (Just Haskell98)
= [Extension
LangExt.ImplicitPrelude,
Extension
LangExt.StarIsType,
Extension
LangExt.MonomorphismRestriction,
Extension
LangExt.NPlusKPatterns,
Extension
LangExt.DatatypeContexts,
Extension
LangExt.TraditionalRecordSyntax,
Extension
LangExt.NondecreasingIndentation
]
languageExtensions (Just Haskell2010)
= [Extension
LangExt.ImplicitPrelude,
Extension
LangExt.StarIsType,
Extension
LangExt.MonomorphismRestriction,
Extension
LangExt.DatatypeContexts,
Extension
LangExt.TraditionalRecordSyntax,
Extension
LangExt.EmptyDataDecls,
Extension
LangExt.ForeignFunctionInterface,
Extension
LangExt.PatternGuards,
Extension
LangExt.DoAndIfThenElse,
Extension
LangExt.RelaxedPolyRec]
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 f :: DumpFlag
f dflags :: 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
>= 4 Bool -> Bool -> Bool
&& DumpFlag -> Bool
enableIfVerbose DumpFlag
f)
where enableIfVerbose :: DumpFlag -> Bool
enableIfVerbose Opt_D_dump_tc_trace = Bool
False
enableIfVerbose Opt_D_dump_rn_trace = Bool
False
enableIfVerbose Opt_D_dump_cs_trace = Bool
False
enableIfVerbose Opt_D_dump_if_trace = Bool
False
enableIfVerbose Opt_D_dump_vt_trace = Bool
False
enableIfVerbose Opt_D_dump_tc = Bool
False
enableIfVerbose Opt_D_dump_rn = Bool
False
enableIfVerbose Opt_D_dump_shape = Bool
False
enableIfVerbose Opt_D_dump_rn_stats = Bool
False
enableIfVerbose Opt_D_dump_hi_diffs = Bool
False
enableIfVerbose Opt_D_verbose_core2core = Bool
False
enableIfVerbose Opt_D_verbose_stg2stg = Bool
False
enableIfVerbose Opt_D_dump_splices = Bool
False
enableIfVerbose Opt_D_th_dec_file = Bool
False
enableIfVerbose Opt_D_dump_rule_firings = Bool
False
enableIfVerbose Opt_D_dump_rule_rewrites = Bool
False
enableIfVerbose Opt_D_dump_simpl_trace = Bool
False
enableIfVerbose Opt_D_dump_rtti = Bool
False
enableIfVerbose Opt_D_dump_inlinings = Bool
False
enableIfVerbose Opt_D_dump_core_stats = Bool
False
enableIfVerbose Opt_D_dump_asm_stats = Bool
False
enableIfVerbose Opt_D_dump_types = Bool
False
enableIfVerbose Opt_D_dump_simpl_iterations = Bool
False
enableIfVerbose Opt_D_dump_ticked = Bool
False
enableIfVerbose Opt_D_dump_view_pattern_commoning = Bool
False
enableIfVerbose Opt_D_dump_mod_cycles = Bool
False
enableIfVerbose Opt_D_dump_mod_map = Bool
False
enableIfVerbose Opt_D_dump_ec_trace = Bool
False
enableIfVerbose _ = Bool
True
dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set dfs :: DynFlags
dfs f :: 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 dfs :: DynFlags
dfs f :: 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 f :: GeneralFlag
f dflags :: 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 dfs :: DynFlags
dfs f :: 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 dfs :: DynFlags
dfs f :: 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 f :: WarningFlag
f dflags :: 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 dfs :: DynFlags
dfs f :: 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 dfs :: DynFlags
dfs f :: 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 f :: WarningFlag
f dflags :: 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 dfs :: DynFlags
dfs f :: 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 dfs :: DynFlags
dfs f :: 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 f :: Extension
f dflags :: 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 dfs :: DynFlags
dfs f :: 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 dfs :: DynFlags
dfs f :: 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 ext :: Extension
ext setUnset :: DynFlags -> Extension -> DynFlags
setUnset dflags :: 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 x :: p
x) = p
x
stripOnOff (Off x :: 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
lang_set :: DynFlags -> Maybe Language -> DynFlags
lang_set :: DynFlags -> Maybe Language -> DynFlags
lang_set dflags :: DynFlags
dflags lang :: 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)
}
useUnicodeSyntax :: DynFlags -> Bool
useUnicodeSyntax :: DynFlags -> Bool
useUnicodeSyntax = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PrintUnicodeSyntax
useStarIsType :: DynFlags -> Bool
useStarIsType :: DynFlags -> Bool
useStarIsType = Extension -> DynFlags -> Bool
xopt Extension
LangExt.StarIsType
setLanguage :: Language -> DynP ()
setLanguage :: Language -> DynP ()
setLanguage l :: Language
l = (DynFlags -> DynFlags) -> DynP ()
upd (DynFlags -> Maybe Language -> DynFlags
`lang_set` Language -> Maybe Language
forall a. a -> Maybe a
Just Language
l)
dynFlagDependencies :: DynFlags -> [ModuleName]
dynFlagDependencies :: DynFlags -> [ModuleName]
dynFlagDependencies = DynFlags -> [ModuleName]
pluginModNames
packageTrustOn :: DynFlags -> Bool
packageTrustOn :: DynFlags -> Bool
packageTrustOn = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PackageTrust
safeHaskellOn :: DynFlags -> Bool
safeHaskellOn :: DynFlags -> Bool
safeHaskellOn dflags :: DynFlags
dflags = DynFlags -> Bool
safeHaskellModeEnabled DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
safeInferOn DynFlags
dflags
safeHaskellModeEnabled :: DynFlags -> Bool
safeHaskellModeEnabled :: DynFlags -> Bool
safeHaskellModeEnabled dflags :: 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 dflags :: 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 dflags :: 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 s :: SafeHaskellMode
s = (DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
f
where f :: DynFlags -> DynP DynFlags
f dfs :: 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
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 }
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 }
_ -> 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 d :: DynFlags
d = DynFlags -> Bool
safeLanguageOn DynFlags
d
safeImplicitImpsReq :: DynFlags -> Bool
safeImplicitImpsReq :: DynFlags -> Bool
safeImplicitImpsReq d :: DynFlags
d = DynFlags -> Bool
safeLanguageOn DynFlags
d
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
combineSafeFlags a :: SafeHaskellMode
a b :: 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 = "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 -> ShowS
forall a. [a] -> [a] -> [a]
++ SafeHaskellMode -> String
forall a. Show a => a -> String
show SafeHaskellMode
b String -> ShowS
forall a. [a] -> [a] -> [a]
++ ")"
unsafeFlags, unsafeFlagsForInfer
:: [(String, DynFlags -> SrcSpan, DynFlags -> Bool, DynFlags -> DynFlags)]
unsafeFlags :: [(String, DynFlags -> SrcSpan, DynFlags -> Bool,
DynFlags -> DynFlags)]
unsafeFlags = [ ("-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)
, ("-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 dflags :: DynFlags
dflags opts :: DynFlags -> [a]
opts = [a] -> [a]
forall a. [a] -> [a]
reverse (DynFlags -> [a]
opts DynFlags
dflags)
getVerbFlags :: DynFlags -> [String]
getVerbFlags :: DynFlags -> [String]
getVerbFlags dflags :: DynFlags
dflags
| DynFlags -> Int
verbosity DynFlags
dflags Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 4 = ["-v"]
| Bool
otherwise = []
setObjectDir, setHiDir, setHieDir, setStubDir, setDumpDir, setOutputDir,
setDynObjectSuf, setDynHiSuf,
setDylibInstallName,
setObjectSuf, setHiSuf, setHieSuf, setHcSuf, parseDynLibLoaderMode,
setPgmP, addOptl, addOptc, addOptP,
addCmdlineFramework, addHaddockOpts, addGhciScript,
setInteractivePrint
:: String -> DynFlags -> DynFlags
setOutputFile, setDynOutputFile, setOutputHi, setDumpPrefixForce
:: Maybe String -> DynFlags -> DynFlags
setObjectDir :: String -> DynFlags -> DynFlags
setObjectDir f :: String
f d :: DynFlags
d = DynFlags
d { objectDir :: Maybe String
objectDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setHiDir :: String -> DynFlags -> DynFlags
setHiDir f :: String
f d :: DynFlags
d = DynFlags
d { hiDir :: Maybe String
hiDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setHieDir :: String -> DynFlags -> DynFlags
setHieDir f :: String
f d :: DynFlags
d = DynFlags
d { hieDir :: Maybe String
hieDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setStubDir :: String -> DynFlags -> DynFlags
setStubDir f :: String
f d :: 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 f :: String
f d :: DynFlags
d = DynFlags
d { dumpDir :: Maybe String
dumpDir = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setOutputDir :: String -> DynFlags -> DynFlags
setOutputDir f :: 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 f :: String
f d :: DynFlags
d = DynFlags
d { dylibInstallName :: Maybe String
dylibInstallName = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
setObjectSuf :: String -> DynFlags -> DynFlags
setObjectSuf f :: String
f d :: DynFlags
d = DynFlags
d { objectSuf :: String
objectSuf = String
f}
setDynObjectSuf :: String -> DynFlags -> DynFlags
setDynObjectSuf f :: String
f d :: DynFlags
d = DynFlags
d { dynObjectSuf :: String
dynObjectSuf = String
f}
setHiSuf :: String -> DynFlags -> DynFlags
setHiSuf f :: String
f d :: DynFlags
d = DynFlags
d { hiSuf :: String
hiSuf = String
f}
setHieSuf :: String -> DynFlags -> DynFlags
setHieSuf f :: String
f d :: DynFlags
d = DynFlags
d { hieSuf :: String
hieSuf = String
f}
setDynHiSuf :: String -> DynFlags -> DynFlags
setDynHiSuf f :: String
f d :: DynFlags
d = DynFlags
d { dynHiSuf :: String
dynHiSuf = String
f}
setHcSuf :: String -> DynFlags -> DynFlags
setHcSuf f :: String
f d :: DynFlags
d = DynFlags
d { hcSuf :: String
hcSuf = String
f}
setOutputFile :: Maybe String -> DynFlags -> DynFlags
setOutputFile f :: Maybe String
f d :: DynFlags
d = DynFlags
d { outputFile :: Maybe String
outputFile = Maybe String
f}
setDynOutputFile :: Maybe String -> DynFlags -> DynFlags
setDynOutputFile f :: Maybe String
f d :: DynFlags
d = DynFlags
d { dynOutputFile :: Maybe String
dynOutputFile = Maybe String
f}
setOutputHi :: Maybe String -> DynFlags -> DynFlags
setOutputHi f :: Maybe String
f d :: DynFlags
d = DynFlags
d { outputHi :: Maybe String
outputHi = Maybe String
f}
setJsonLogAction :: DynFlags -> DynFlags
setJsonLogAction :: DynFlags -> DynFlags
setJsonLogAction d :: DynFlags
d = DynFlags
d { log_action :: LogAction
log_action = LogAction
jsonLogAction }
thisComponentId :: DynFlags -> ComponentId
thisComponentId :: DynFlags -> ComponentId
thisComponentId dflags :: DynFlags
dflags =
case DynFlags -> Maybe ComponentId
thisComponentId_ DynFlags
dflags of
Just cid :: ComponentId
cid -> ComponentId
cid
Nothing ->
case DynFlags -> Maybe [(ModuleName, Module)]
thisUnitIdInsts_ DynFlags
dflags of
Just _ ->
GhcException -> ComponentId
forall a. GhcException -> a
throwGhcException (GhcException -> ComponentId) -> GhcException -> ComponentId
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError ("Use of -instantiated-with requires -this-component-id")
Nothing -> FastString -> ComponentId
ComponentId (UnitId -> FastString
unitIdFS (DynFlags -> UnitId
thisPackage DynFlags
dflags))
thisUnitIdInsts :: DynFlags -> [(ModuleName, Module)]
thisUnitIdInsts :: DynFlags -> [(ModuleName, Module)]
thisUnitIdInsts dflags :: DynFlags
dflags =
case DynFlags -> Maybe [(ModuleName, Module)]
thisUnitIdInsts_ DynFlags
dflags of
Just insts :: [(ModuleName, Module)]
insts -> [(ModuleName, Module)]
insts
Nothing -> []
thisPackage :: DynFlags -> UnitId
thisPackage :: DynFlags -> UnitId
thisPackage dflags :: DynFlags
dflags =
case DynFlags -> Maybe [(ModuleName, Module)]
thisUnitIdInsts_ DynFlags
dflags of
Nothing -> UnitId
default_uid
Just insts :: [(ModuleName, Module)]
insts
| ((ModuleName, Module) -> Bool) -> [(ModuleName, Module)] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (\(x :: ModuleName
x,y :: Module
y) -> ModuleName -> Module
mkHoleModule ModuleName
x Module -> Module -> Bool
forall a. Eq a => a -> a -> Bool
== Module
y) [(ModuleName, Module)]
insts
-> ComponentId -> [(ModuleName, Module)] -> UnitId
newUnitId (DynFlags -> ComponentId
thisComponentId DynFlags
dflags) [(ModuleName, Module)]
insts
| Bool
otherwise
-> UnitId
default_uid
where
default_uid :: UnitId
default_uid = DefUnitId -> UnitId
DefiniteUnitId (InstalledUnitId -> DefUnitId
DefUnitId (DynFlags -> InstalledUnitId
thisInstalledUnitId DynFlags
dflags))
parseUnitIdInsts :: String -> [(ModuleName, Module)]
parseUnitIdInsts :: String -> [(ModuleName, Module)]
parseUnitIdInsts str :: 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 -> 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
[(r :: [(ModuleName, Module)]
r, "")] -> [(ModuleName, Module)]
r
_ -> GhcException -> [(ModuleName, Module)]
forall a. GhcException -> a
throwGhcException (GhcException -> [(ModuleName, Module)])
-> GhcException -> [(ModuleName, Module)]
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError ("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 ',')
parseEntry :: ReadP (ModuleName, Module)
parseEntry = do
ModuleName
n <- ReadP ModuleName
parseModuleName
Char
_ <- Char -> ReadP Char
R.char '='
Module
m <- ReadP Module
parseModuleId
(ModuleName, Module) -> ReadP (ModuleName, Module)
forall (m :: * -> *) a. Monad m => a -> m a
return (ModuleName
n, Module
m)
setUnitIdInsts :: String -> DynFlags -> DynFlags
setUnitIdInsts :: String -> DynFlags -> DynFlags
setUnitIdInsts s :: String
s d :: DynFlags
d =
DynFlags
d { thisUnitIdInsts_ :: Maybe [(ModuleName, Module)]
thisUnitIdInsts_ = [(ModuleName, Module)] -> Maybe [(ModuleName, Module)]
forall a. a -> Maybe a
Just (String -> [(ModuleName, Module)]
parseUnitIdInsts String
s) }
setComponentId :: String -> DynFlags -> DynFlags
setComponentId :: String -> DynFlags -> DynFlags
setComponentId s :: String
s d :: DynFlags
d =
DynFlags
d { thisComponentId_ :: Maybe ComponentId
thisComponentId_ = ComponentId -> Maybe ComponentId
forall a. a -> Maybe a
Just (FastString -> ComponentId
ComponentId (String -> FastString
fsLit String
s)) }
addPluginModuleName :: String -> DynFlags -> DynFlags
addPluginModuleName :: String -> DynFlags -> DynFlags
addPluginModuleName name :: String
name d :: 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 d :: DynFlags
d =
DynFlags
d { pluginModNames :: [ModuleName]
pluginModNames = []
, pluginModNameOpts :: [(ModuleName, String)]
pluginModNameOpts = []
, cachedPlugins :: [LoadedPlugin]
cachedPlugins = [] }
addPluginModuleNameOption :: String -> DynFlags -> DynFlags
addPluginModuleNameOption :: String -> DynFlags -> DynFlags
addPluginModuleNameOption optflag :: String
optflag d :: 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 (m :: String
m, rest :: 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
== ':') String
optflag
option :: String
option = case String
rest of
[] -> ""
(_:plug_opt :: String
plug_opt) -> String
plug_opt
addFrontendPluginOption :: String -> DynFlags -> DynFlags
addFrontendPluginOption :: String -> DynFlags -> DynFlags
addFrontendPluginOption s :: String
s d :: 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 f :: String
f d :: DynFlags
d =
case Int -> String -> (String, String)
forall a. Int -> [a] -> ([a], [a])
splitAt 8 String
f of
("deploy", "") -> DynFlags
d { dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
Deployable }
("sysdep", "") -> DynFlags
d { dynLibLoader :: DynLibLoader
dynLibLoader = DynLibLoader
SystemDependent }
_ -> GhcException -> DynFlags
forall a. GhcException -> a
throwGhcException (String -> GhcException
CmdLineError ("Unknown dynlib loader: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
f))
setDumpPrefixForce :: Maybe String -> DynFlags -> DynFlags
setDumpPrefixForce f :: Maybe String
f d :: DynFlags
d = DynFlags
d { dumpPrefixForce :: Maybe String
dumpPrefixForce = Maybe String
f}
setPgmP :: String -> DynFlags -> DynFlags
setPgmP f :: String
f = let (pgm :: String
pgm:args :: [String]
args) = String -> [String]
words String
f in (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_P :: (String, [Option])
sPgm_P = (String
pgm, (String -> Option) -> [String] -> [Option]
forall a b. (a -> b) -> [a] -> [b]
map String -> Option
Option [String]
args)})
addOptl :: String -> DynFlags -> DynFlags
addOptl f :: String
f = (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_l :: [String]
sOpt_l = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_l Settings
s})
addOptc :: String -> DynFlags -> DynFlags
addOptc f :: String
f = (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_c :: [String]
sOpt_c = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_c Settings
s})
addOptP :: String -> DynFlags -> DynFlags
addOptP f :: String
f = (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_P :: [String]
sOpt_P = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_P Settings
s
, sOpt_P_fingerprint :: Fingerprint
sOpt_P_fingerprint = [String] -> Fingerprint
fingerprintStrings (String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_P Settings
s)
})
where
fingerprintStrings :: [String] -> Fingerprint
fingerprintStrings ss :: [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 f :: String
f d :: DynFlags
d = DynFlags
d { depMakefile :: String
depMakefile = String
f }
setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps b :: Bool
b d :: DynFlags
d = DynFlags
d { depIncludePkgDeps :: Bool
depIncludePkgDeps = Bool
b }
addDepExcludeMod :: String -> DynFlags -> DynFlags
addDepExcludeMod :: String -> DynFlags -> DynFlags
addDepExcludeMod m :: String
m d :: 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 s :: String
s d :: 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 f :: String
f d :: 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 f :: String
f d :: DynFlags
d = DynFlags
d { ghcVersionFile :: Maybe String
ghcVersionFile = String -> Maybe String
forall a. a -> Maybe a
Just String
f }
addHaddockOpts :: String -> DynFlags -> DynFlags
addHaddockOpts f :: String
f d :: DynFlags
d = DynFlags
d { haddockOptions :: Maybe String
haddockOptions = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
addGhciScript :: String -> DynFlags -> DynFlags
addGhciScript f :: String
f d :: 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 f :: String
f d :: DynFlags
d = DynFlags
d { interactivePrint :: Maybe String
interactivePrint = String -> Maybe String
forall a. a -> Maybe a
Just String
f}
data Option
= FileOption
String
String
| Option String
deriving ( Option -> Option -> Bool
(Option -> Option -> Bool)
-> (Option -> Option -> Bool) -> Eq Option
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Option -> Option -> Bool
$c/= :: Option -> Option -> Bool
== :: Option -> Option -> Bool
$c== :: Option -> Option -> Bool
Eq )
showOpt :: Option -> String
showOpt :: Option -> String
showOpt (FileOption pre :: String
pre f :: String
f) = String
pre String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
f
showOpt (Option s :: String
s) = String
s
updOptLevel :: Int -> DynFlags -> DynFlags
updOptLevel :: Int -> DynFlags -> DynFlags
updOptLevel n :: Int
n dfs :: DynFlags
dfs
= DynFlags
dfs2{ optLevel :: Int
optLevel = Int
final_n }
where
final_n :: Int
final_n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max 0 (Int -> Int -> Int
forall a. Ord a => a -> a -> a
min 2 Int
n)
dfs1 :: DynFlags
dfs1 = (GeneralFlag -> DynFlags -> DynFlags)
-> DynFlags -> [GeneralFlag] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr ((DynFlags -> GeneralFlag -> DynFlags)
-> GeneralFlag -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> GeneralFlag -> DynFlags
gopt_unset) DynFlags
dfs [GeneralFlag]
remove_gopts
dfs2 :: DynFlags
dfs2 = (GeneralFlag -> DynFlags -> DynFlags)
-> DynFlags -> [GeneralFlag] -> DynFlags
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr ((DynFlags -> GeneralFlag -> DynFlags)
-> GeneralFlag -> DynFlags -> DynFlags
forall a b c. (a -> b -> c) -> b -> a -> c
flip DynFlags -> GeneralFlag -> DynFlags
gopt_set) DynFlags
dfs1 [GeneralFlag]
extra_gopts
extra_gopts :: [GeneralFlag]
extra_gopts = [ GeneralFlag
f | (ns :: [Int]
ns,f :: 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 | (ns :: [Int]
ns,f :: 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 ]
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
parseDynamicFlagsFull :: 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 activeFlags :: [Flag (CmdLineP DynFlags)]
activeFlags cmdline :: Bool
cmdline dflags0 :: DynFlags
dflags0 args :: [Located String]
args = do
let ((leftover :: [Located String]
leftover, errs :: [Err]
errs, warns :: [Warn]
warns), dflags1 :: DynFlags
dflags1)
= CmdLineP DynFlags ([Located String], [Err], [Warn])
-> DynFlags -> (([Located String], [Err], [Warn]), DynFlags)
forall s a. CmdLineP s a -> s -> (a, s)
runCmdLine ([Flag (CmdLineP DynFlags)]
-> [Located String]
-> CmdLineP DynFlags ([Located String], [Err], [Warn])
forall (m :: * -> *).
Monad m =>
[Flag m] -> [Located String] -> m ([Located String], [Err], [Warn])
processArgs [Flag (CmdLineP DynFlags)]
activeFlags [Located String]
args) DynFlags
dflags0
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 ((DynFlags -> SrcSpan -> String
forall a. Outputable a => DynFlags -> a -> String
showPpr DynFlags
dflags0 (SrcSpan -> String)
-> (Located String -> SrcSpan) -> Located String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Located String -> SrcSpan
forall a. HasSrcSpan a => a -> SrcSpan
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 a. HasSrcSpan a => a -> SrcSpanLess a
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 (dflags2 :: DynFlags
dflags2, sh_warns :: [Located String]
sh_warns) = Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck Bool
cmdline DynFlags
dflags1
dflags3 :: DynFlags
dflags3 = DynFlags -> DynFlags
updateWays DynFlags
dflags2
theWays :: [Way]
theWays = DynFlags -> [Way]
ways DynFlags
dflags3
Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ([Way] -> Bool
allowed_combination [Way]
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 ("combination not supported: " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate "/" ((Way -> String) -> [Way] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Way -> String
wayDesc [Way]
theWays)))
let chooseOutput :: m DynFlags
chooseOutput
| Maybe String -> Bool
forall a. Maybe a -> Bool
isJust (DynFlags -> Maybe String
outputFile DynFlags
dflags3)
, Bool -> Bool
not (Maybe String -> Bool
forall a. Maybe a -> Bool
isJust (DynFlags -> Maybe String
dynOutputFile DynFlags
dflags3))
= DynFlags -> m DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> m DynFlags) -> DynFlags -> m DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dflags3 { dynOutputFile :: Maybe String
dynOutputFile = String -> Maybe String
forall a. a -> Maybe a
Just (String -> Maybe String) -> String -> Maybe String
forall a b. (a -> b) -> a -> b
$ ShowS
dynOut (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (Maybe String -> String) -> Maybe String -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> Maybe String
outputFile DynFlags
dflags3) }
| Bool
otherwise
= DynFlags -> m DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags3
where
dynOut :: ShowS
dynOut = (String -> ShowS) -> String -> ShowS
forall a b c. (a -> b -> c) -> b -> a -> c
flip String -> ShowS
addExtension (DynFlags -> String
dynObjectSuf DynFlags
dflags3) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
dropExtension
DynFlags
dflags4 <- DynFlags -> m DynFlags -> m DynFlags -> m DynFlags
forall (m :: * -> *) a. MonadIO m => DynFlags -> m a -> m a -> m a
ifGeneratingDynamicToo DynFlags
dflags3 m DynFlags
chooseOutput (DynFlags -> m DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags3)
let (dflags5 :: DynFlags
dflags5, consistency_warnings :: [Located String]
consistency_warnings) = DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent DynFlags
dflags4
Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (DynFlags -> Bool
enableTimeStats DynFlags
dflags5) (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
dflags5) of
Just x :: Int
x -> IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (Int -> IO ()
setHeapSize Int
x)
_ -> () -> 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
dflags5
let warns' :: [Warn]
warns' = (Located String -> Warn) -> [Located String] -> [Warn]
forall a b. (a -> b) -> [a] -> [b]
map (WarnReason -> Located String -> Warn
Warn WarnReason
Cmd.NoReason) ([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
dflags5, [Located String]
leftover, [Warn]
warns' [Warn] -> [Warn] -> [Warn]
forall a. [a] -> [a] -> [a]
++ [Warn]
warns)
putLogMsg :: DynFlags -> WarnReason -> Severity -> SrcSpan -> PprStyle
-> MsgDoc -> IO ()
putLogMsg :: LogAction
putLogMsg dflags :: DynFlags
dflags = DynFlags -> LogAction
log_action DynFlags
dflags DynFlags
dflags
updateWays :: DynFlags -> DynFlags
updateWays :: DynFlags -> DynFlags
updateWays dflags :: DynFlags
dflags
= let theWays :: [Way]
theWays = [Way] -> [Way]
forall a. Ord a => [a] -> [a]
sort ([Way] -> [Way]) -> [Way] -> [Way]
forall a b. (a -> b) -> a -> b
$ [Way] -> [Way]
forall a. Eq a => [a] -> [a]
nub ([Way] -> [Way]) -> [Way] -> [Way]
forall a b. (a -> b) -> a -> b
$ DynFlags -> [Way]
ways DynFlags
dflags
in DynFlags
dflags {
ways :: [Way]
ways = [Way]
theWays,
buildTag :: String
buildTag = [Way] -> String
mkBuildTag ((Way -> Bool) -> [Way] -> [Way]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (Way -> Bool) -> Way -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Way -> Bool
wayRTSOnly) [Way]
theWays)
}
safeFlagCheck :: Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck :: Bool -> DynFlags -> (DynFlags, [Located String])
safeFlagCheck _ dflags :: DynFlags
dflags | DynFlags -> Bool
safeLanguageOn DynFlags
dflags = (DynFlags
dflagsUnset, [Located String]
warns)
where
(dflagsUnset :: DynFlags
dflagsUnset, warns :: [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 (df :: a
df, warns :: [GenLocated l String]
warns) (str :: String
str,loc :: a -> l
loc,test :: a -> Bool
test,fix :: 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 loc :: l
loc str :: 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]
++ " is not allowed in Safe Haskell; ignoring "
String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str]
safeFlagCheck cmdl :: Bool
cmdl dflags :: DynFlags
dflags =
case (DynFlags -> Bool
safeInferOn DynFlags
dflags) of
True | Bool
safeFlags -> (DynFlags
dflags', [Located String]
warn)
True -> (DynFlags
dflags' { safeInferred :: Bool
safeInferred = Bool
False }, [Located String]
warn)
False -> (DynFlags
dflags', [Located String]
warn)
where
(dflags' :: DynFlags
dflags', warn :: [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
$
"-fpackage-trust ignored;" String -> ShowS
forall a. [a] -> [a] -> [a]
++
" 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 (\(_,_,t :: DynFlags -> Bool
t,_) -> 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 keepDeprecated :: Bool
keepDeprecated = [ '-'Char -> ShowS
forall a. a -> [a] -> [a]
:Flag (CmdLineP DynFlags) -> String
forall (m :: * -> *). Flag m -> String
flagName Flag (CmdLineP DynFlags)
flag
| (deprecated :: Deprecation
deprecated, flag :: 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 Deprecated = Bool
True
isDeprecated _ = 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 fm :: DynFlagMaker
fm name :: String
name kind :: 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 fm :: DynFlagMaker
fm name :: String
name kind :: OptKind (CmdLineP DynFlags)
kind message :: 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 f :: DynP ()
f) message :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 f :: Maybe Int -> DynP ()
f) message :: 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
$ \oi :: 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 f :: Int -> DynP ()
f) message :: 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
$ \i :: 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 (FloatSuffix f :: Float -> DynP ()
f) message :: 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
$ \fl :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 f :: String -> DynP ()
f) message :: 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
$ \s :: 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 "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 ())
"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 "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 "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 "#include"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\_s :: String
_s ->
String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate ("-#include and INCLUDE pragmas are " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"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 "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 "j" ((Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix
(\n :: Maybe Int
n -> case Maybe Int
n of
Just n :: Int
n
| Int
n Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> 0 -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "Syntax: -j[n] where n > 0"
Nothing -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "instantiated-with" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg String -> DynFlags -> DynFlags
setUnitIdInsts)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "this-component-id" ((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg String -> DynFlags -> DynFlags
setComponentId)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "H" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\s :: String
s -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "Rghc-timing" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "prof" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWay Way
WayProf))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "eventlog" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWay Way
WayEventLog))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "smp"
(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
$ Way -> DynP ()
addWay Way
WayThreaded) "Use -threaded instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "debug" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWay Way
WayDebug))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "threaded" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWay Way
WayThreaded))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 ()
addWay Way
WayDebug))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "dynamic" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (Way -> DynP ()
addWay Way
WayDyn))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "-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 "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 "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 "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 "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
defFlag "pgmlo"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_lo :: (String, [Option])
sPgm_lo = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmlc"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_lc :: (String, [Option])
sPgm_lc = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmi"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_i :: String
sPgm_i = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmL"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_L :: String
sPgm_L = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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 "pgmF"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_F :: String
sPgm_F = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmc"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_c :: (String, [Option])
sPgm_c = (String
f,[]),
sGccSupportsNoPie :: Bool
sGccSupportsNoPie = Bool
False})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgms"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_s :: (String, [Option])
sPgm_s = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgma"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_a :: (String, [Option])
sPgm_a = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgml"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_l :: (String, [Option])
sPgm_l = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmdll"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_dll :: (String, [Option])
sPgm_dll = (String
f,[])})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmwindres"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_windres :: String
sPgm_windres = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmlibtool"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_libtool :: String
sPgm_libtool = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmar"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_ar :: String
sPgm_ar = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "pgmranlib"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sPgm_ranlib :: String
sPgm_ranlib = String
f})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "optlo"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_lo :: [String]
sOpt_lo = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_lo Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "optlc"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_lc :: [String]
sOpt_lc = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_lc Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "opti"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_i :: [String]
sOpt_i = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_i Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "optL"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_L :: [String]
sOpt_L = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_L Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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 "optF"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_F :: [String]
sOpt_F = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_F Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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 "opta"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f -> (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_a :: [String]
sOpt_a = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_a Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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 "optwindres"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg (\f :: String
f ->
(Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sOpt_windres :: [String]
sOpt_windres = String
f String -> [String] -> [String]
forall a. a -> [a] -> [a]
: Settings -> [String]
sOpt_windres Settings
s})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "split-objs"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (if Bool
can_split
then GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_SplitObjs
else String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addWarn "ignoring -split-objs"))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "split-sections"
((DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
noArgM (\dflags :: DynFlags
dflags -> do
if Platform -> Bool
platformHasSubsectionsViaSymbols (DynFlags -> Platform
targetPlatform DynFlags
dflags)
then do String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
addErr (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$
"-split-sections is not useful on this platform " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"since it always uses subsections via symbols."
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 "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 "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 "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 "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 "no-link"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "shared"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "staticlib"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: DynFlags
d -> 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 "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 "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 "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 "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
. ("-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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "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 "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 "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 "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
$ HscTarget -> DynP ()
setObjTarget HscTarget
HscLlvm 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 "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
$ HscTarget -> DynP ()
setObjTarget HscTarget
HscLlvm 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "no-rtsopts-suggestions"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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)
"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 "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) "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 "fmax-errors"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 1 Int
n) }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fno-max-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "freverse-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fno-reverse-errors"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "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 "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 "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 "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 "dppr-user-length" ((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "dppr-cols" ((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fdiagnostics-color=auto"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "fdiagnostics-color=always"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "fdiagnostics-color=never"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "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_SuppressTimestamps)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "ddump-asm-expanded"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_asm_expanded)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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
$ HscTarget -> DynP ()
setObjTarget HscTarget
HscLlvm 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "ddump-stg"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_stg)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "ddump-shape"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_shape)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "ddump-vt-trace"
(DumpFlag -> OptKind (CmdLineP DynFlags)
setDumpFlag DumpFlag
Opt_D_dump_vt_trace)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "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 "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 "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 "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 2) DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> DynP ()
setVerboseCore2Core)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 2))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "dfaststring-stats"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
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 "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 "fast-llvm"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_FastLlvm))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "ddump-json"
((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_set DumpFlag
Opt_D_dump_json (DynFlags -> DynFlags)
-> (DynFlags -> DynFlags) -> DynFlags -> DynFlags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DynFlags -> DynFlags
setJsonLogAction ) )
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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 "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 "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 "msse" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "msse2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "msse3" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "msse4" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "msse4.2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mbmi" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mbmi2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx2" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx512cd" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx512er" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx512f" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "mavx512pf" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "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 "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 "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 "Wnot" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d ->
DynFlags
d {warningFlags :: EnumSet WarningFlag
warningFlags = EnumSet WarningFlag
forall a. EnumSet a
EnumSet.empty})))
"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 "w" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "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 "Wno-everything"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((DynFlags -> DynFlags) -> DynP ()
upd (\d :: 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 0 )
"Use -O0 instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "O" ((Maybe Int -> DynFlags -> DynP DynFlags)
-> OptKind (CmdLineP DynFlags)
optIntSuffixM (\mb_n :: Maybe Int
mb_n ->
Int -> DynFlags -> DynP DynFlags
setOptLevel (Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` 1)))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fmax-relevant-binds"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-max-relevant-binds"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fmax-valid-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-max-valid-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fmax-refinement-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-max-refinement-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "frefinement-level-hole-fits"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-refinement-level-hole-fits"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fllvm-pass-vectors-in-regs"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg DynFlags -> DynFlags
forall a. a -> a
id)
"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 "fmax-uncovered-patterns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fsimplifier-phases"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fmax-simplifier-iterations"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d { maxSimplIterations :: Int
maxSimplIterations = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fmax-pmcheck-iterations"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d{ maxPmCheckIterations :: Int
maxPmCheckIterations = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fsimpl-tick-factor"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fspec-constr-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-spec-constr-threshold"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fspec-constr-count"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-spec-constr-count"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fspec-constr-recursive"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fliberate-case-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fno-liberate-case-threshold"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "drule-check"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (\s :: String
s d :: 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 "dinline-check"
((String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
sepArg (\s :: String
s d :: DynFlags
d -> DynFlags
d { inlineCheck :: Maybe String
inlineCheck = 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 "freduction-depth"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fconstraint-solver-iterations"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d { solverIterations :: IntWithInf
solverIterations = Int -> IntWithInf
treatZeroAsInf Int
n }))
, (Deprecation
Deprecated, DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fcontext-stack"
((Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM (\n :: Int
n d :: DynFlags
d ->
do { String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ "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]
++ " 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 "ftype-function-depth"
((Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM (\n :: Int
n d :: DynFlags
d ->
do { String -> DynP ()
forall (m :: * -> *). Monad m => String -> EwM m ()
deprecate (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$ "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]
++ " 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 "fstrictness-before"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "ffloat-lam-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "ffloat-all-lams"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fstg-lift-lams-rec-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fstg-lift-lams-rec-args-any"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fstg-lift-lams-non-rec-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fstg-lift-lams-non-rec-args-any"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fstg-lift-lams-known"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fno-stg-lift-lams-known"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fproc-alignment"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fblock-layout-weights"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (\s :: String
s ->
(DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { cfgWeightInfo :: CfgWeights
cfgWeightInfo =
String -> CfgWeights -> CfgWeights
parseCfgWeights String
s (DynFlags -> CfgWeights
cfgWeightInfo DynFlags
d)})))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fhistory-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "funfolding-creation-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d {ufCreationThreshold :: Int
ufCreationThreshold = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "funfolding-use-threshold"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d {ufUseThreshold :: Int
ufUseThreshold = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "funfolding-fun-discount"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d {ufFunAppDiscount :: Int
ufFunAppDiscount = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "funfolding-dict-discount"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d {ufDictDiscount :: Int
ufDictDiscount = Int
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "funfolding-keeness-factor"
((Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix (\n :: Float
n d :: DynFlags
d -> DynFlags
d {ufKeenessFactor :: Float
ufKeenessFactor = Float
n}))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fmax-worker-args"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fghci-hist-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fmax-inline-alloc-size"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fmax-inline-memcpy-insns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "fmax-inline-memset-insns"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "dinitial-unique"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: DynFlags
d -> DynFlags
d { initialUnique :: Int
initialUnique = Int
n }))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "dunique-increment"
((Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix (\n :: Int
n d :: 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 "auto-all"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoAll } ))
"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 "no-auto-all"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto } ))
"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 "auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
ProfAutoExports } ))
"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 "no-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: DynFlags
d -> DynFlags
d { profAuto :: ProfAuto
profAuto = ProfAuto
NoProfAuto } ))
"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 "caf-all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_AutoSccsOnIndividualCafs))
"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 "no-caf-all"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (GeneralFlag -> DynP ()
unSetGeneralFlag GeneralFlag
Opt_AutoSccsOnIndividualCafs))
"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 "fprof-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fprof-auto-top"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fprof-auto-exported"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fprof-auto-calls"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fno-prof-auto"
((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "fasm" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (HscTarget -> DynP ()
setObjTarget HscTarget
HscAsm))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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
$ "The -fvia-c flag does nothing; " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"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 "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
$ "The -fvia-C flag does nothing; " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"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 "fllvm" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (HscTarget -> DynP ()
setObjTarget HscTarget
HscLlvm))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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
$ \d :: DynFlags
d ->
DynFlags
d { ghcLink :: GhcLink
ghcLink=GhcLink
NoLink }) DynP () -> DynP () -> DynP ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> HscTarget -> DynP ()
setTarget HscTarget
HscNothing))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fbyte-code" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (HscTarget -> DynP ()
setTarget HscTarget
HscInterpreted))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fobject-code" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg ((Platform -> HscTarget) -> DynP ()
setTargetWithPlatform
Platform -> HscTarget
defaultHscTarget))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "fglasgow-exts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
enableGlasgowExts) "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 "fno-glasgow-exts"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
disableGlasgowExts) "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 "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 "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 "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 "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 "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 "fno-safe-infer" ((DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
noArg (\d :: 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 "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 "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 "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 "fPIE" (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 "fno-PIE" (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 "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 "" 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "W"),
(Deprecation
Deprecated, String -> Flag (CmdLineP DynFlags)
unrecognisedWarning "fwarn-"),
(Deprecation
Deprecated, String -> Flag (CmdLineP DynFlags)
unrecognisedWarning "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 "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 "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 "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 "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 "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 "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 "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 "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 "X" SafeHaskellMode -> DynP ()
setSafeHaskell ) [(Deprecation, FlagSpec SafeHaskellMode)]
safeHaskellFlagsDeps
[(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
-> [(Deprecation, Flag (CmdLineP DynFlags))]
forall a. [a] -> [a] -> [a]
++ [ DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "XGenerics"
(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 ())
("it does nothing; look into -XDefaultSignatures " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"and -XDeriveGeneric for generic programming support.")
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "XNoGenerics"
(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 ())
("it does nothing; look into -XDefaultSignatures and " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"-XDeriveGeneric for generic programming support.") ]
unrecognisedWarning :: String -> Flag (CmdLineP DynFlags)
unrecognisedWarning :: String -> Flag (CmdLineP DynFlags)
unrecognisedWarning prefix :: 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 flag :: 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
$ WarnReason -> String -> DynP ()
forall (m :: * -> *). Monad m => WarnReason -> String -> EwM m ()
addFlagWarn WarnReason
Cmd.ReasonUnrecognisedFlag (String -> DynP ()) -> String -> DynP ()
forall a b. (a -> b) -> a -> b
$
"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 "package-db"
((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg (PkgConfRef -> DynP ()
addPkgConfRef (PkgConfRef -> DynP ())
-> (String -> PkgConfRef) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PkgConfRef
PkgConfFile))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "clear-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
clearPkgConf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "no-global-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeGlobalPkgConf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "no-user-package-db" (DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeUserPkgConf)
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "global-package-db"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (PkgConfRef -> DynP ()
addPkgConfRef PkgConfRef
GlobalPkgConf))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "user-package-db"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (PkgConfRef -> DynP ()
addPkgConfRef PkgConfRef
UserPkgConf))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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
$ PkgConfRef -> DynP ()
addPkgConfRef (PkgConfRef -> DynP ())
-> (String -> PkgConfRef) -> String -> DynP ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PkgConfRef
PkgConfFile) "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 "no-user-package-conf"
(DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg DynP ()
removeUserPkgConf) "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 "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
$ \name :: String
name -> do
(DynFlags -> DynFlags) -> DynP ()
upd (String -> DynFlags -> DynFlags
setUnitId String
name))
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "this-package-key" ((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
$ (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
setUnitId)
"Use -this-unit-id instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defGhcFlag "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
defFlag "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 "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 "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 "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 "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 "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 "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 "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 "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 "syslib" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
exposePackage) "Use -package instead"
, DynFlagMaker
-> String
-> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag DynFlagMaker
forall (m :: * -> *). String -> OptKind m -> Flag m
defFlag "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 "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 "distrust" ((String -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (String -> EwM m ()) -> OptKind m
HasArg String -> DynP ()
distrustPackage)
]
where
setPackageEnv :: String -> DynP ()
setPackageEnv env :: String
env = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \s :: 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 isInteractive :: Bool
isInteractive
= [ '-'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 AllModes = Bool
True
modeFilter OnlyGhci = Bool
isInteractive
modeFilter OnlyGhc = Bool -> Bool
not Bool
isInteractive
modeFilter 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 name :: String
name flag :: 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' name :: String
name flag :: flag
flag act :: 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)
depFlagSpecOp :: String -> flag -> (TurnOnFlag -> DynP ()) -> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp :: String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp name :: String
name flag :: flag
flag act :: Bool -> DynP ()
act dep :: 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 (\f :: 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 name :: String
name flag :: flag
flag dep :: 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
depFlagSpecOp' :: String
-> flag
-> (TurnOnFlag -> DynP ())
-> (TurnOnFlag -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' :: String
-> flag
-> (Bool -> DynP ())
-> (Bool -> String)
-> (Deprecation, FlagSpec flag)
depFlagSpecOp' name :: String
name flag :: flag
flag act :: Bool -> DynP ()
act dep :: 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 (\f :: 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' name :: String
name flag :: flag
flag dep :: 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 name :: String
name flag :: flag
flag cond :: Bool -> Bool
cond dep :: 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 (\f :: 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 name :: String
name flag :: 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' name :: String
name flag :: flag
flag act :: 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 name :: String
name flag :: 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' name :: String
name flag :: flag
flag act :: 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 (dep :: Deprecation
dep, fs :: 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 turn_on :: Bool
turn_on flagPrefix :: String
flagPrefix f :: flag -> DynP ()
f (dep :: Deprecation
dep, (FlagSpec name :: String
name flag :: flag
flag extra_action :: Bool -> DynP ()
extra_action mode :: 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)
deprecatedForExtension :: String -> TurnOnFlag -> String
deprecatedForExtension :: String -> Bool -> String
deprecatedForExtension lang :: String
lang turn_on :: Bool
turn_on
= "use -X" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++
" or pragma {-# LANGUAGE " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
flag String -> ShowS
forall a. [a] -> [a] -> [a]
++ " #-} instead"
where
flag :: String
flag | Bool
turn_on = String
lang
| Bool
otherwise = "No" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
lang
useInstead :: String -> String -> TurnOnFlag -> String
useInstead :: String -> String -> Bool -> String
useInstead prefix :: String
prefix flag :: String
flag turn_on :: Bool
turn_on
= "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]
++ " instead"
where
no :: String
no = if Bool
turn_on then "" else "no-"
nop :: TurnOnFlag -> DynP ()
nop :: Bool -> DynP ()
nop _ = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
flagSpecOf :: WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf :: WarningFlag -> Maybe (FlagSpec WarningFlag)
flagSpecOf flag :: WarningFlag
flag = [FlagSpec WarningFlag] -> Maybe (FlagSpec WarningFlag)
forall a. [a] -> Maybe a
listToMaybe ([FlagSpec WarningFlag] -> Maybe (FlagSpec WarningFlag))
-> [FlagSpec WarningFlag] -> Maybe (FlagSpec WarningFlag)
forall a b. (a -> b) -> a -> b
$ (FlagSpec WarningFlag -> Bool)
-> [FlagSpec WarningFlag] -> [FlagSpec WarningFlag]
forall a. (a -> Bool) -> [a] -> [a]
filter FlagSpec WarningFlag -> Bool
check [FlagSpec WarningFlag]
wWarningFlags
where
check :: FlagSpec WarningFlag -> Bool
check fs :: FlagSpec WarningFlag
fs = FlagSpec WarningFlag -> WarningFlag
forall flag. FlagSpec flag -> flag
flagSpecFlag FlagSpec WarningFlag
fs WarningFlag -> WarningFlag -> Bool
forall a. Eq a => a -> a -> Bool
== WarningFlag
flag
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 = [
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "alternative-layout-rule-transitional"
WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional,
String
-> WarningFlag -> String -> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "auto-orphans" WarningFlag
Opt_WarnAutoOrphans
"it has no effect",
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cpp-undef" WarningFlag
Opt_WarnCPPUndef,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unbanged-strict-patterns" WarningFlag
Opt_WarnUnbangedStrictPatterns,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "deferred-type-errors" WarningFlag
Opt_WarnDeferredTypeErrors,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "deferred-out-of-scope-variables"
WarningFlag
Opt_WarnDeferredOutOfScopeVariables,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "deprecations" WarningFlag
Opt_WarnWarningsDeprecations,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "deprecated-flags" WarningFlag
Opt_WarnDeprecatedFlags,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "deriving-typeable" WarningFlag
Opt_WarnDerivingTypeable,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dodgy-exports" WarningFlag
Opt_WarnDodgyExports,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dodgy-foreign-imports" WarningFlag
Opt_WarnDodgyForeignImports,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dodgy-imports" WarningFlag
Opt_WarnDodgyImports,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "empty-enumerations" WarningFlag
Opt_WarnEmptyEnumerations,
String
-> WarningFlag -> String -> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "duplicate-constraints" WarningFlag
Opt_WarnDuplicateConstraints
"it is subsumed by -Wredundant-constraints",
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "redundant-constraints" WarningFlag
Opt_WarnRedundantConstraints,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "duplicate-exports" WarningFlag
Opt_WarnDuplicateExports,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "hi-shadowing" WarningFlag
Opt_WarnHiShadows,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "inaccessible-code" WarningFlag
Opt_WarnInaccessibleCode,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "implicit-prelude" WarningFlag
Opt_WarnImplicitPrelude,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "implicit-kind-vars" WarningFlag
Opt_WarnImplicitKindVars,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "incomplete-patterns" WarningFlag
Opt_WarnIncompletePatterns,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "incomplete-record-updates" WarningFlag
Opt_WarnIncompletePatternsRecUpd,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "incomplete-uni-patterns" WarningFlag
Opt_WarnIncompleteUniPatterns,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "inline-rule-shadowing" WarningFlag
Opt_WarnInlineRuleShadowing,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "identities" WarningFlag
Opt_WarnIdentities,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-fields" WarningFlag
Opt_WarnMissingFields,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-import-lists" WarningFlag
Opt_WarnMissingImportList,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-export-lists" WarningFlag
Opt_WarnMissingExportList,
String
-> WarningFlag -> String -> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "missing-local-sigs" WarningFlag
Opt_WarnMissingLocalSignatures
"it is replaced by -Wmissing-local-signatures",
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-local-signatures" WarningFlag
Opt_WarnMissingLocalSignatures,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-methods" WarningFlag
Opt_WarnMissingMethods,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-monadfail-instances" WarningFlag
Opt_WarnMissingMonadFailInstances,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "semigroup" WarningFlag
Opt_WarnSemigroup,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-signatures" WarningFlag
Opt_WarnMissingSignatures,
String
-> WarningFlag -> String -> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "missing-exported-sigs" WarningFlag
Opt_WarnMissingExportedSignatures
"it is replaced by -Wmissing-exported-signatures",
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-exported-signatures" WarningFlag
Opt_WarnMissingExportedSignatures,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "monomorphism-restriction" WarningFlag
Opt_WarnMonomorphism,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "name-shadowing" WarningFlag
Opt_WarnNameShadowing,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "noncanonical-monad-instances"
WarningFlag
Opt_WarnNonCanonicalMonadInstances,
String
-> WarningFlag -> String -> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "noncanonical-monadfail-instances"
WarningFlag
Opt_WarnNonCanonicalMonadInstances
"fail is no longer a method of Monad",
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "noncanonical-monoid-instances"
WarningFlag
Opt_WarnNonCanonicalMonoidInstances,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "orphans" WarningFlag
Opt_WarnOrphans,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "overflowed-literals" WarningFlag
Opt_WarnOverflowedLiterals,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "overlapping-patterns" WarningFlag
Opt_WarnOverlappingPatterns,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missed-specialisations" WarningFlag
Opt_WarnMissedSpecs,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missed-specializations" WarningFlag
Opt_WarnMissedSpecs,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "all-missed-specialisations" WarningFlag
Opt_WarnAllMissedSpecs,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "all-missed-specializations" WarningFlag
Opt_WarnAllMissedSpecs,
String
-> WarningFlag
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "safe" WarningFlag
Opt_WarnSafe Bool -> DynP ()
setWarnSafe,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "trustworthy-safe" WarningFlag
Opt_WarnTrustworthySafe,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "tabs" WarningFlag
Opt_WarnTabs,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "type-defaults" WarningFlag
Opt_WarnTypeDefaults,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "typed-holes" WarningFlag
Opt_WarnTypedHoles,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "partial-type-signatures" WarningFlag
Opt_WarnPartialTypeSignatures,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unrecognised-pragmas" WarningFlag
Opt_WarnUnrecognisedPragmas,
String
-> WarningFlag
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec WarningFlag)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "unsafe" WarningFlag
Opt_WarnUnsafe Bool -> DynP ()
setWarnUnsafe,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unsupported-calling-conventions"
WarningFlag
Opt_WarnUnsupportedCallingConventions,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unsupported-llvm-version" WarningFlag
Opt_WarnUnsupportedLlvmVersion,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missed-extra-shared-lib" WarningFlag
Opt_WarnMissedExtraSharedLib,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unticked-promoted-constructors"
WarningFlag
Opt_WarnUntickedPromotedConstructors,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-do-bind" WarningFlag
Opt_WarnUnusedDoBind,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-foralls" WarningFlag
Opt_WarnUnusedForalls,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-imports" WarningFlag
Opt_WarnUnusedImports,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-local-binds" WarningFlag
Opt_WarnUnusedLocalBinds,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-matches" WarningFlag
Opt_WarnUnusedMatches,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-pattern-binds" WarningFlag
Opt_WarnUnusedPatternBinds,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-top-binds" WarningFlag
Opt_WarnUnusedTopBinds,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unused-type-patterns" WarningFlag
Opt_WarnUnusedTypePatterns,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "warnings-deprecations" WarningFlag
Opt_WarnWarningsDeprecations,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "wrong-do-bind" WarningFlag
Opt_WarnWrongDoBind,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-pattern-synonym-signatures"
WarningFlag
Opt_WarnMissingPatternSynonymSignatures,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-deriving-strategies" WarningFlag
Opt_WarnMissingDerivingStrategies,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "simplifiable-class-constraints" WarningFlag
Opt_WarnSimplifiableClassConstraints,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-home-modules" WarningFlag
Opt_WarnMissingHomeModules,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unrecognised-warning-flags" WarningFlag
Opt_WarnUnrecognisedWarningFlags,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "star-binder" WarningFlag
Opt_WarnStarBinder,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "star-is-type" WarningFlag
Opt_WarnStarIsType,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "missing-space-after-bang" WarningFlag
Opt_WarnSpaceAfterBang,
String -> WarningFlag -> (Deprecation, FlagSpec WarningFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "partial-fields" WarningFlag
Opt_WarnPartialFields ]
negatableFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps :: [(Deprecation, FlagSpec GeneralFlag)]
negatableFlagsDeps = [
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "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 "ppr-case-as-let" GeneralFlag
Opt_PprCaseAsLet,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "ppr-ticks" GeneralFlag
Opt_PprShowTicks
(\turn_on :: Bool
turn_on -> String -> String -> Bool -> String
useInstead "-d" "suppress-ticks" (Bool -> Bool
not Bool
turn_on)),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-ticks" GeneralFlag
Opt_SuppressTicks,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "suppress-stg-free-vars" GeneralFlag
Opt_SuppressStgExts
(String -> String -> Bool -> String
useInstead "-d" "suppress-stg-exts"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-stg-exts" GeneralFlag
Opt_SuppressStgExts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-coercions" GeneralFlag
Opt_SuppressCoercions,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-idinfo" GeneralFlag
Opt_SuppressIdInfo,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-unfoldings" GeneralFlag
Opt_SuppressUnfoldings,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-module-prefixes" GeneralFlag
Opt_SuppressModulePrefixes,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-timestamps" GeneralFlag
Opt_SuppressTimestamps,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-type-applications" GeneralFlag
Opt_SuppressTypeApplications,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-type-signatures" GeneralFlag
Opt_SuppressTypeSignatures,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-uniques" GeneralFlag
Opt_SuppressUniques,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "suppress-var-kinds" GeneralFlag
Opt_SuppressVarKinds
]
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 "asm-shortcutting" GeneralFlag
Opt_AsmShortcutting,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "break-on-error" GeneralFlag
Opt_BreakOnError,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "break-on-exception" GeneralFlag
Opt_BreakOnException,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "building-cabal-package" GeneralFlag
Opt_BuildingCabalPackage,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "call-arity" GeneralFlag
Opt_CallArity,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "exitification" GeneralFlag
Opt_Exitification,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "case-merge" GeneralFlag
Opt_CaseMerge,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "case-folding" GeneralFlag
Opt_CaseFolding,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cmm-elim-common-blocks" GeneralFlag
Opt_CmmElimCommonBlocks,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cmm-sink" GeneralFlag
Opt_CmmSink,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cse" GeneralFlag
Opt_CSE,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "stg-cse" GeneralFlag
Opt_StgCSE,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "stg-lift-lams" GeneralFlag
Opt_StgLiftLams,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cpr-anal" GeneralFlag
Opt_CprAnal,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "defer-type-errors" GeneralFlag
Opt_DeferTypeErrors,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "defer-typed-holes" GeneralFlag
Opt_DeferTypedHoles,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "defer-out-of-scope-variables" GeneralFlag
Opt_DeferOutOfScopeVariables,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "diagnostics-show-caret" GeneralFlag
Opt_DiagnosticsShowCaret,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dicts-cheap" GeneralFlag
Opt_DictsCheap,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dicts-strict" GeneralFlag
Opt_DictsStrict,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "dmd-tx-dict-sel" GeneralFlag
Opt_DmdTxDictSel,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "do-eta-reduction" GeneralFlag
Opt_DoEtaReduction,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "do-lambda-eta-expansion" GeneralFlag
Opt_DoLambdaEtaExpansion,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "eager-blackholing" GeneralFlag
Opt_EagerBlackHoling,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "embed-manifest" GeneralFlag
Opt_EmbedManifest,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "enable-rewrite-rules" GeneralFlag
Opt_EnableRewriteRules,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "error-spans" GeneralFlag
Opt_ErrorSpans,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "excess-precision" GeneralFlag
Opt_ExcessPrecision,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "expose-all-unfoldings" GeneralFlag
Opt_ExposeAllUnfoldings,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "external-dynamic-refs" GeneralFlag
Opt_ExternalDynamicRefs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "external-interpreter" GeneralFlag
Opt_ExternalInterpreter,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "flat-cache" GeneralFlag
Opt_FlatCache,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "float-in" GeneralFlag
Opt_FloatIn,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "force-recomp" GeneralFlag
Opt_ForceRecomp,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ignore-optim-changes" GeneralFlag
Opt_IgnoreOptimChanges,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ignore-hpc-changes" GeneralFlag
Opt_IgnoreHpcChanges,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "full-laziness" GeneralFlag
Opt_FullLaziness,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "fun-to-thunk" GeneralFlag
Opt_FunToThunk,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "gen-manifest" GeneralFlag
Opt_GenManifest,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ghci-history" GeneralFlag
Opt_GhciHistory,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ghci-leak-check" GeneralFlag
Opt_GhciLeakCheck,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "validate-ide-info" GeneralFlag
Opt_ValidateHie,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "local-ghci-history" GeneralFlag
Opt_LocalGhciHistory,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "no-it" GeneralFlag
Opt_NoIt,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ghci-sandbox" GeneralFlag
Opt_GhciSandbox,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "helpful-errors" GeneralFlag
Opt_HelpfulErrors,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "hpc" GeneralFlag
Opt_Hpc,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ignore-asserts" GeneralFlag
Opt_IgnoreAsserts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ignore-interface-pragmas" GeneralFlag
Opt_IgnoreInterfacePragmas,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "implicit-import-qualified" GeneralFlag
Opt_ImplicitImportQualified,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "irrefutable-tuples" GeneralFlag
Opt_IrrefutableTuples,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "kill-absence" GeneralFlag
Opt_KillAbsence,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "kill-one-shot" GeneralFlag
Opt_KillOneShot,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "late-dmd-anal" GeneralFlag
Opt_LateDmdAnal,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "late-specialise" GeneralFlag
Opt_LateSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "liberate-case" GeneralFlag
Opt_LiberateCase,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec "llvm-tbaa" GeneralFlag
Opt_LlvmTBAA,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagHiddenSpec "llvm-fill-undef-with-garbage" GeneralFlag
Opt_LlvmFillUndefWithGarbage,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "loopification" GeneralFlag
Opt_Loopification,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "block-layout-cfg" GeneralFlag
Opt_CfgBlocklayout,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "block-layout-weightless" GeneralFlag
Opt_WeightlessBlocklayout,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "omit-interface-pragmas" GeneralFlag
Opt_OmitInterfacePragmas,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "omit-yields" GeneralFlag
Opt_OmitYields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "optimal-applicative-do" GeneralFlag
Opt_OptimalApplicativeDo,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "pedantic-bottoms" GeneralFlag
Opt_PedanticBottoms,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "pre-inlining" GeneralFlag
Opt_SimplPreInlining,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "print-bind-contents" GeneralFlag
Opt_PrintBindContents,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "print-bind-result" GeneralFlag
Opt_PrintBindResult,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagGhciSpec "print-evld-with-show" GeneralFlag
Opt_PrintEvldWithShow,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-explicit-foralls" GeneralFlag
Opt_PrintExplicitForalls,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-explicit-kinds" GeneralFlag
Opt_PrintExplicitKinds,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-explicit-coercions" GeneralFlag
Opt_PrintExplicitCoercions,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-explicit-runtime-reps" GeneralFlag
Opt_PrintExplicitRuntimeReps,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-equality-relations" GeneralFlag
Opt_PrintEqualityRelations,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-unicode-syntax" GeneralFlag
Opt_PrintUnicodeSyntax,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-expanded-synonyms" GeneralFlag
Opt_PrintExpandedSynonyms,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-potential-instances" GeneralFlag
Opt_PrintPotentialInstances,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "print-typechecker-elaboration" GeneralFlag
Opt_PrintTypecheckerElaboration,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "prof-cafs" GeneralFlag
Opt_AutoSccsOnIndividualCafs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "prof-count-entries" GeneralFlag
Opt_ProfCountEntries,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "regs-graph" GeneralFlag
Opt_RegsGraph,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "regs-iterative" GeneralFlag
Opt_RegsIterative,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "rewrite-rules" GeneralFlag
Opt_EnableRewriteRules
(String -> String -> Bool -> String
useInstead "-f" "enable-rewrite-rules"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "shared-implib" GeneralFlag
Opt_SharedImplib,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "spec-constr" GeneralFlag
Opt_SpecConstr,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "spec-constr-keen" GeneralFlag
Opt_SpecConstrKeen,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "specialise" GeneralFlag
Opt_Specialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "specialize" GeneralFlag
Opt_Specialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "specialise-aggressively" GeneralFlag
Opt_SpecialiseAggressively,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "specialize-aggressively" GeneralFlag
Opt_SpecialiseAggressively,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cross-module-specialise" GeneralFlag
Opt_CrossModuleSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "cross-module-specialize" GeneralFlag
Opt_CrossModuleSpecialise,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "static-argument-transformation" GeneralFlag
Opt_StaticArgumentTransformation,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "strictness" GeneralFlag
Opt_Strictness,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "use-rpaths" GeneralFlag
Opt_RPath,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "write-interface" GeneralFlag
Opt_WriteInterface,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "write-ide-info" GeneralFlag
Opt_WriteHie,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unbox-small-strict-fields" GeneralFlag
Opt_UnboxSmallStrictFields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "unbox-strict-fields" GeneralFlag
Opt_UnboxStrictFields,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "version-macros" GeneralFlag
Opt_VersionMacros,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "worker-wrapper" GeneralFlag
Opt_WorkerWrapper,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "solve-constant-dicts" GeneralFlag
Opt_SolveConstantDicts,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "catch-bottoms" GeneralFlag
Opt_CatchBottoms,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "alignment-sanitisation" GeneralFlag
Opt_AlignmentSanitisation,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "num-constant-folding" GeneralFlag
Opt_NumConstantFolding,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-warning-groups" GeneralFlag
Opt_ShowWarnGroups,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "hide-source-paths" GeneralFlag
Opt_HideSourcePaths,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-loaded-modules" GeneralFlag
Opt_ShowLoadedModules,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "whole-archive-hs-libs" GeneralFlag
Opt_WholeArchiveHsLibs,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "keep-cafs" GeneralFlag
Opt_KeepCAFs
]
[(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 "show-hole-constraints" GeneralFlag
Opt_ShowHoleConstraints,
String
-> GeneralFlag
-> (Bool -> String)
-> (Deprecation, FlagSpec GeneralFlag)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "show-valid-substitutions" GeneralFlag
Opt_ShowValidHoleFits
(String -> String -> Bool -> String
useInstead "-f" "show-valid-hole-fits"),
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-valid-hole-fits" GeneralFlag
Opt_ShowValidHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "sort-valid-hole-fits" GeneralFlag
Opt_SortValidHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "sort-by-size-hole-fits" GeneralFlag
Opt_SortBySizeHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "sort-by-subsumption-hole-fits" GeneralFlag
Opt_SortBySubsumHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "abstract-refinement-hole-fits" GeneralFlag
Opt_AbstractRefHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-hole-matches-of-hole-fits" GeneralFlag
Opt_ShowMatchesOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-provenance-of-hole-fits" GeneralFlag
Opt_ShowProvOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-type-of-hole-fits" GeneralFlag
Opt_ShowTypeOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-type-app-of-hole-fits" GeneralFlag
Opt_ShowTypeAppOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-type-app-vars-of-hole-fits" GeneralFlag
Opt_ShowTypeAppVarsOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "show-docs-of-hole-fits" GeneralFlag
Opt_ShowDocsOfHoleFits,
String -> GeneralFlag -> (Deprecation, FlagSpec GeneralFlag)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "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' "th" Extension
LangExt.TemplateHaskell
Bool -> DynP ()
checkTemplateHaskellOk
(String -> Bool -> String
deprecatedForExtension "TemplateHaskell"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "fi" Extension
LangExt.ForeignFunctionInterface
(String -> Bool -> String
deprecatedForExtension "ForeignFunctionInterface"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "ffi" Extension
LangExt.ForeignFunctionInterface
(String -> Bool -> String
deprecatedForExtension "ForeignFunctionInterface"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "arrows" Extension
LangExt.Arrows
(String -> Bool -> String
deprecatedForExtension "Arrows"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "implicit-prelude" Extension
LangExt.ImplicitPrelude
(String -> Bool -> String
deprecatedForExtension "ImplicitPrelude"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "bang-patterns" Extension
LangExt.BangPatterns
(String -> Bool -> String
deprecatedForExtension "BangPatterns"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "monomorphism-restriction" Extension
LangExt.MonomorphismRestriction
(String -> Bool -> String
deprecatedForExtension "MonomorphismRestriction"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "mono-pat-binds" Extension
LangExt.MonoPatBinds
(String -> Bool -> String
deprecatedForExtension "MonoPatBinds"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "extended-default-rules" Extension
LangExt.ExtendedDefaultRules
(String -> Bool -> String
deprecatedForExtension "ExtendedDefaultRules"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "implicit-params" Extension
LangExt.ImplicitParams
(String -> Bool -> String
deprecatedForExtension "ImplicitParams"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "scoped-type-variables" Extension
LangExt.ScopedTypeVariables
(String -> Bool -> String
deprecatedForExtension "ScopedTypeVariables"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "allow-overlapping-instances" Extension
LangExt.OverlappingInstances
(String -> Bool -> String
deprecatedForExtension "OverlappingInstances"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "allow-undecidable-instances" Extension
LangExt.UndecidableInstances
(String -> Bool -> String
deprecatedForExtension "UndecidableInstances"),
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "allow-incoherent-instances" Extension
LangExt.IncoherentInstances
(String -> Bool -> String
deprecatedForExtension "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 :: [String]
supportedExtensions :: [String]
supportedExtensions = (FlagSpec Extension -> [String])
-> [FlagSpec Extension] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap FlagSpec Extension -> [String]
forall flag. FlagSpec flag -> [String]
toFlagSpecNamePair [FlagSpec Extension]
xFlags
where
toFlagSpecNamePair :: FlagSpec flag -> [String]
toFlagSpecNamePair flg :: FlagSpec flag
flg
| Bool
otherwise = [String
name, String
noName]
where
noName :: String
noName = "No" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
name
name :: String
name = FlagSpec flag -> String
forall flag. FlagSpec flag -> String
flagSpecName FlagSpec flag
flg
supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions =
[String]
supportedLanguages [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
supportedLanguageOverlays [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
supportedExtensions
languageFlagsDeps :: [(Deprecation, FlagSpec Language)]
languageFlagsDeps :: [(Deprecation, FlagSpec Language)]
languageFlagsDeps = [
String -> Language -> (Deprecation, FlagSpec Language)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "Haskell98" Language
Haskell98,
String -> Language -> (Deprecation, FlagSpec Language)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "Haskell2010" Language
Haskell2010
]
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
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 "AllowAmbiguousTypes" Extension
LangExt.AllowAmbiguousTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "AlternativeLayoutRule" Extension
LangExt.AlternativeLayoutRule,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "AlternativeLayoutRuleTransitional"
Extension
LangExt.AlternativeLayoutRuleTransitional,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "Arrows" Extension
LangExt.Arrows,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond "AutoDeriveTypeable" Extension
LangExt.AutoDeriveTypeable
Bool -> Bool
forall a. a -> a
id
("Typeable instances are created automatically " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"for all types since GHC 8.2."),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "BangPatterns" Extension
LangExt.BangPatterns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "BinaryLiterals" Extension
LangExt.BinaryLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "CApiFFI" Extension
LangExt.CApiFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "CPP" Extension
LangExt.Cpp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ConstrainedClassMethods" Extension
LangExt.ConstrainedClassMethods,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ConstraintKinds" Extension
LangExt.ConstraintKinds,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DataKinds" Extension
LangExt.DataKinds,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond "DatatypeContexts" Extension
LangExt.DatatypeContexts
Bool -> Bool
forall a. a -> a
id
("It was widely considered a misfeature, " String -> ShowS
forall a. [a] -> [a] -> [a]
++
"and has been removed from the Haskell language."),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DefaultSignatures" Extension
LangExt.DefaultSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveAnyClass" Extension
LangExt.DeriveAnyClass,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveDataTypeable" Extension
LangExt.DeriveDataTypeable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveFoldable" Extension
LangExt.DeriveFoldable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveFunctor" Extension
LangExt.DeriveFunctor,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveGeneric" Extension
LangExt.DeriveGeneric,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveLift" Extension
LangExt.DeriveLift,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DeriveTraversable" Extension
LangExt.DeriveTraversable,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DerivingStrategies" Extension
LangExt.DerivingStrategies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DerivingVia" Extension
LangExt.DerivingVia,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DisambiguateRecordFields" Extension
LangExt.DisambiguateRecordFields,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DoAndIfThenElse" Extension
LangExt.DoAndIfThenElse,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "BlockArguments" Extension
LangExt.BlockArguments,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "DoRec" Extension
LangExt.RecursiveDo
(String -> Bool -> String
deprecatedForExtension "RecursiveDo"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "DuplicateRecordFields" Extension
LangExt.DuplicateRecordFields,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "EmptyCase" Extension
LangExt.EmptyCase,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "EmptyDataDecls" Extension
LangExt.EmptyDataDecls,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "EmptyDataDeriving" Extension
LangExt.EmptyDataDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ExistentialQuantification" Extension
LangExt.ExistentialQuantification,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ExplicitForAll" Extension
LangExt.ExplicitForAll,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ExplicitNamespaces" Extension
LangExt.ExplicitNamespaces,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ExtendedDefaultRules" Extension
LangExt.ExtendedDefaultRules,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "FlexibleContexts" Extension
LangExt.FlexibleContexts,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "FlexibleInstances" Extension
LangExt.FlexibleInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ForeignFunctionInterface" Extension
LangExt.ForeignFunctionInterface,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "FunctionalDependencies" Extension
LangExt.FunctionalDependencies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "GADTSyntax" Extension
LangExt.GADTSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "GADTs" Extension
LangExt.GADTs,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "GHCForeignImportPrim" Extension
LangExt.GHCForeignImportPrim,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "GeneralizedNewtypeDeriving" Extension
LangExt.GeneralizedNewtypeDeriving
Bool -> DynP ()
setGenDeriving,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "GeneralisedNewtypeDeriving" Extension
LangExt.GeneralizedNewtypeDeriving
Bool -> DynP ()
setGenDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ImplicitParams" Extension
LangExt.ImplicitParams,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ImplicitPrelude" Extension
LangExt.ImplicitPrelude,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ImpredicativeTypes" Extension
LangExt.ImpredicativeTypes,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "IncoherentInstances" Extension
LangExt.IncoherentInstances
Bool -> DynP ()
setIncoherentInsts,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeFamilyDependencies" Extension
LangExt.TypeFamilyDependencies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "InstanceSigs" Extension
LangExt.InstanceSigs,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ApplicativeDo" Extension
LangExt.ApplicativeDo,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "InterruptibleFFI" Extension
LangExt.InterruptibleFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "JavaScriptFFI" Extension
LangExt.JavaScriptFFI,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "KindSignatures" Extension
LangExt.KindSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "LambdaCase" Extension
LangExt.LambdaCase,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "LiberalTypeSynonyms" Extension
LangExt.LiberalTypeSynonyms,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MagicHash" Extension
LangExt.MagicHash,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MonadComprehensions" Extension
LangExt.MonadComprehensions,
String -> Extension -> String -> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> String -> (Deprecation, FlagSpec flag)
depFlagSpec "MonadFailDesugaring" Extension
LangExt.MonadFailDesugaring
"MonadFailDesugaring is now the default behavior",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MonoLocalBinds" Extension
LangExt.MonoLocalBinds,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond "MonoPatBinds" Extension
LangExt.MonoPatBinds
Bool -> Bool
forall a. a -> a
id
"Experimental feature now removed; has no effect",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MonomorphismRestriction" Extension
LangExt.MonomorphismRestriction,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MultiParamTypeClasses" Extension
LangExt.MultiParamTypeClasses,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "MultiWayIf" Extension
LangExt.MultiWayIf,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NumericUnderscores" Extension
LangExt.NumericUnderscores,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NPlusKPatterns" Extension
LangExt.NPlusKPatterns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NamedFieldPuns" Extension
LangExt.RecordPuns,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NamedWildCards" Extension
LangExt.NamedWildCards,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NegativeLiterals" Extension
LangExt.NegativeLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "HexFloatLiterals" Extension
LangExt.HexFloatLiterals,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NondecreasingIndentation" Extension
LangExt.NondecreasingIndentation,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "NullaryTypeClasses" Extension
LangExt.NullaryTypeClasses
(String -> Bool -> String
deprecatedForExtension "MultiParamTypeClasses"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "NumDecimals" Extension
LangExt.NumDecimals,
String
-> Extension
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag
-> (Bool -> DynP ())
-> String
-> (Deprecation, FlagSpec flag)
depFlagSpecOp "OverlappingInstances" Extension
LangExt.OverlappingInstances
Bool -> DynP ()
setOverlappingInsts
"instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "OverloadedLabels" Extension
LangExt.OverloadedLabels,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "OverloadedLists" Extension
LangExt.OverloadedLists,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "OverloadedStrings" Extension
LangExt.OverloadedStrings,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PackageImports" Extension
LangExt.PackageImports,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ParallelArrays" Extension
LangExt.ParallelArrays,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ParallelListComp" Extension
LangExt.ParallelListComp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PartialTypeSignatures" Extension
LangExt.PartialTypeSignatures,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PatternGuards" Extension
LangExt.PatternGuards,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "PatternSignatures" Extension
LangExt.ScopedTypeVariables
(String -> Bool -> String
deprecatedForExtension "ScopedTypeVariables"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PatternSynonyms" Extension
LangExt.PatternSynonyms,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PolyKinds" Extension
LangExt.PolyKinds,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PolymorphicComponents" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "QuantifiedConstraints" Extension
LangExt.QuantifiedConstraints,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "PostfixOperators" Extension
LangExt.PostfixOperators,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "QuasiQuotes" Extension
LangExt.QuasiQuotes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "Rank2Types" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RankNTypes" Extension
LangExt.RankNTypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RebindableSyntax" Extension
LangExt.RebindableSyntax,
String
-> Extension
-> (Bool -> String)
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> String) -> (Deprecation, FlagSpec flag)
depFlagSpec' "RecordPuns" Extension
LangExt.RecordPuns
(String -> Bool -> String
deprecatedForExtension "NamedFieldPuns"),
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RecordWildCards" Extension
LangExt.RecordWildCards,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RecursiveDo" Extension
LangExt.RecursiveDo,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RelaxedLayout" Extension
LangExt.RelaxedLayout,
String
-> Extension
-> (Bool -> Bool)
-> String
-> (Deprecation, FlagSpec Extension)
forall flag.
String
-> flag -> (Bool -> Bool) -> String -> (Deprecation, FlagSpec flag)
depFlagSpecCond "RelaxedPolyRec" Extension
LangExt.RelaxedPolyRec
Bool -> Bool
not
"You can't turn off RelaxedPolyRec any more",
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "RoleAnnotations" Extension
LangExt.RoleAnnotations,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ScopedTypeVariables" Extension
LangExt.ScopedTypeVariables,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "StandaloneDeriving" Extension
LangExt.StandaloneDeriving,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "StarIsType" Extension
LangExt.StarIsType,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "StaticPointers" Extension
LangExt.StaticPointers,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "Strict" Extension
LangExt.Strict,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "StrictData" Extension
LangExt.StrictData,
String
-> Extension
-> (Bool -> DynP ())
-> (Deprecation, FlagSpec Extension)
forall flag.
String -> flag -> (Bool -> DynP ()) -> (Deprecation, FlagSpec flag)
flagSpec' "TemplateHaskell" Extension
LangExt.TemplateHaskell
Bool -> DynP ()
checkTemplateHaskellOk,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TemplateHaskellQuotes" Extension
LangExt.TemplateHaskellQuotes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TraditionalRecordSyntax" Extension
LangExt.TraditionalRecordSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TransformListComp" Extension
LangExt.TransformListComp,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TupleSections" Extension
LangExt.TupleSections,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeApplications" Extension
LangExt.TypeApplications,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeInType" Extension
LangExt.TypeInType,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeFamilies" Extension
LangExt.TypeFamilies,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeOperators" Extension
LangExt.TypeOperators,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "TypeSynonymInstances" Extension
LangExt.TypeSynonymInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UnboxedTuples" Extension
LangExt.UnboxedTuples,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UnboxedSums" Extension
LangExt.UnboxedSums,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UndecidableInstances" Extension
LangExt.UndecidableInstances,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UndecidableSuperClasses" Extension
LangExt.UndecidableSuperClasses,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UnicodeSyntax" Extension
LangExt.UnicodeSyntax,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "UnliftedFFITypes" Extension
LangExt.UnliftedFFITypes,
String -> Extension -> (Deprecation, FlagSpec Extension)
forall flag. String -> flag -> (Deprecation, FlagSpec flag)
flagSpec "ViewPatterns" Extension
LangExt.ViewPatterns
]
defaultFlags :: Settings -> [GeneralFlag]
defaultFlags :: Settings -> [GeneralFlag]
defaultFlags settings :: Settings
settings
= [ GeneralFlag
Opt_AutoLinkPackages,
GeneralFlag
Opt_DiagnosticsShowCaret,
GeneralFlag
Opt_EmbedManifest,
GeneralFlag
Opt_FlatCache,
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_RPath,
GeneralFlag
Opt_SharedImplib,
GeneralFlag
Opt_SimplPreInlining,
GeneralFlag
Opt_VersionMacros
]
[GeneralFlag] -> [GeneralFlag] -> [GeneralFlag]
forall a. [a] -> [a] -> [a]
++ [GeneralFlag
f | (ns :: [Int]
ns,f :: GeneralFlag
f) <- [([Int], GeneralFlag)]
optLevelFlags, 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]
++ (Way -> [GeneralFlag]) -> [Way] -> [GeneralFlag]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Platform -> Way -> [GeneralFlag]
wayGeneralFlags Platform
platform) (Settings -> [Way]
defaultWays Settings
settings)
[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
platform =
case (Platform -> OS
platformOS Platform
platform, Platform -> Arch
platformArch Platform
platform) of
(OSDarwin, ArchX86_64) -> [GeneralFlag
Opt_PIC]
(OSOpenBSD, ArchX86_64) -> [GeneralFlag
Opt_PIC]
_ -> []
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_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.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)
]
optLevelFlags :: [([Int], GeneralFlag)]
optLevelFlags :: [([Int], GeneralFlag)]
optLevelFlags
= [ ([0,1,2], GeneralFlag
Opt_DoLambdaEtaExpansion)
, ([0,1,2], GeneralFlag
Opt_DoEtaReduction)
, ([0,1,2], GeneralFlag
Opt_DmdTxDictSel)
, ([0,1,2], GeneralFlag
Opt_LlvmTBAA)
, ([0], GeneralFlag
Opt_IgnoreInterfacePragmas)
, ([0], GeneralFlag
Opt_OmitInterfacePragmas)
, ([1,2], GeneralFlag
Opt_CallArity)
, ([1,2], GeneralFlag
Opt_Exitification)
, ([1,2], GeneralFlag
Opt_CaseMerge)
, ([1,2], GeneralFlag
Opt_CaseFolding)
, ([1,2], GeneralFlag
Opt_CmmElimCommonBlocks)
, ([2], GeneralFlag
Opt_AsmShortcutting)
, ([1,2], GeneralFlag
Opt_CmmSink)
, ([1,2], GeneralFlag
Opt_CSE)
, ([1,2], GeneralFlag
Opt_StgCSE)
, ([2], GeneralFlag
Opt_StgLiftLams)
, ([1,2], GeneralFlag
Opt_EnableRewriteRules)
, ([1,2], GeneralFlag
Opt_FloatIn)
, ([1,2], GeneralFlag
Opt_FullLaziness)
, ([1,2], GeneralFlag
Opt_IgnoreAsserts)
, ([1,2], GeneralFlag
Opt_Loopification)
, ([1,2], GeneralFlag
Opt_CfgBlocklayout)
, ([1,2], GeneralFlag
Opt_Specialise)
, ([1,2], GeneralFlag
Opt_CrossModuleSpecialise)
, ([1,2], GeneralFlag
Opt_Strictness)
, ([1,2], GeneralFlag
Opt_UnboxSmallStrictFields)
, ([1,2], GeneralFlag
Opt_CprAnal)
, ([1,2], GeneralFlag
Opt_WorkerWrapper)
, ([1,2], GeneralFlag
Opt_SolveConstantDicts)
, ([1,2], GeneralFlag
Opt_NumConstantFolding)
, ([2], GeneralFlag
Opt_LiberateCase)
, ([2], GeneralFlag
Opt_SpecConstr)
]
warningGroups :: [(String, [WarningFlag])]
warningGroups :: [(String, [WarningFlag])]
warningGroups =
[ ("compat", [WarningFlag]
minusWcompatOpts)
, ("unused-binds", [WarningFlag]
unusedBindsFlags)
, ("default", [WarningFlag]
standardWarnings)
, ("extra", [WarningFlag]
minusWOpts)
, ("all", [WarningFlag]
minusWallOpts)
, ("everything", [WarningFlag]
minusWeverythingOpts)
]
warningHierarchies :: [[String]]
warningHierarchies :: [[String]]
warningHierarchies = [[String]]
hierarchies [[String]] -> [[String]] -> [[String]]
forall a. [a] -> [a] -> [a]
++ (String -> [String]) -> [String] -> [[String]]
forall a b. (a -> b) -> [a] -> [b]
map (String -> [String] -> [String]
forall a. a -> [a] -> [a]
:[]) [String]
rest
where
hierarchies :: [[String]]
hierarchies = [["default", "extra", "all"]]
rest :: [String]
rest = (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter (String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` "everything" String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [[String]] -> [String]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[String]]
hierarchies) ([String] -> [String]) -> [String] -> [String]
forall a b. (a -> b) -> a -> b
$
((String, [WarningFlag]) -> String)
-> [(String, [WarningFlag])] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String, [WarningFlag]) -> String
forall a b. (a, b) -> a
fst [(String, [WarningFlag])]
warningGroups
smallestGroups :: WarningFlag -> [String]
smallestGroups :: WarningFlag -> [String]
smallestGroups flag :: WarningFlag
flag = ([String] -> Maybe String) -> [[String]] -> [String]
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe [String] -> Maybe String
go [[String]]
warningHierarchies where
go :: [String] -> Maybe String
go (group :: String
group:rest :: [String]
rest) = Maybe String -> Maybe (Maybe String) -> Maybe String
forall a. a -> Maybe a -> a
fromMaybe ([String] -> Maybe String
go [String]
rest) (Maybe (Maybe String) -> Maybe String)
-> Maybe (Maybe String) -> Maybe String
forall a b. (a -> b) -> a -> b
$ do
[WarningFlag]
flags <- String -> [(String, [WarningFlag])] -> Maybe [WarningFlag]
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
group [(String, [WarningFlag])]
warningGroups
Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (WarningFlag
flag WarningFlag -> [WarningFlag] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [WarningFlag]
flags)
Maybe String -> Maybe (Maybe String)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> Maybe String
forall a. a -> Maybe a
Just String
group)
go [] = Maybe String
forall a. Maybe a
Nothing
standardWarnings :: [WarningFlag]
standardWarnings :: [WarningFlag]
standardWarnings
= [ WarningFlag
Opt_WarnOverlappingPatterns,
WarningFlag
Opt_WarnWarningsDeprecations,
WarningFlag
Opt_WarnDeprecatedFlags,
WarningFlag
Opt_WarnDeferredTypeErrors,
WarningFlag
Opt_WarnTypedHoles,
WarningFlag
Opt_WarnDeferredOutOfScopeVariables,
WarningFlag
Opt_WarnPartialTypeSignatures,
WarningFlag
Opt_WarnUnrecognisedPragmas,
WarningFlag
Opt_WarnDuplicateExports,
WarningFlag
Opt_WarnOverflowedLiterals,
WarningFlag
Opt_WarnEmptyEnumerations,
WarningFlag
Opt_WarnMissingFields,
WarningFlag
Opt_WarnMissingMethods,
WarningFlag
Opt_WarnWrongDoBind,
WarningFlag
Opt_WarnUnsupportedCallingConventions,
WarningFlag
Opt_WarnDodgyForeignImports,
WarningFlag
Opt_WarnInlineRuleShadowing,
WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional,
WarningFlag
Opt_WarnUnsupportedLlvmVersion,
WarningFlag
Opt_WarnMissedExtraSharedLib,
WarningFlag
Opt_WarnTabs,
WarningFlag
Opt_WarnUnrecognisedWarningFlags,
WarningFlag
Opt_WarnSimplifiableClassConstraints,
WarningFlag
Opt_WarnStarBinder,
WarningFlag
Opt_WarnInaccessibleCode,
WarningFlag
Opt_WarnSpaceAfterBang
]
minusWOpts :: [WarningFlag]
minusWOpts :: [WarningFlag]
minusWOpts
= [WarningFlag]
standardWarnings [WarningFlag] -> [WarningFlag] -> [WarningFlag]
forall a. [a] -> [a] -> [a]
++
[ WarningFlag
Opt_WarnUnusedTopBinds,
WarningFlag
Opt_WarnUnusedLocalBinds,
WarningFlag
Opt_WarnUnusedPatternBinds,
WarningFlag
Opt_WarnUnusedMatches,
WarningFlag
Opt_WarnUnusedForalls,
WarningFlag
Opt_WarnUnusedImports,
WarningFlag
Opt_WarnIncompletePatterns,
WarningFlag
Opt_WarnDodgyExports,
WarningFlag
Opt_WarnDodgyImports,
WarningFlag
Opt_WarnUnbangedStrictPatterns
]
minusWallOpts :: [WarningFlag]
minusWallOpts :: [WarningFlag]
minusWallOpts
= [WarningFlag]
minusWOpts [WarningFlag] -> [WarningFlag] -> [WarningFlag]
forall a. [a] -> [a] -> [a]
++
[ WarningFlag
Opt_WarnTypeDefaults,
WarningFlag
Opt_WarnNameShadowing,
WarningFlag
Opt_WarnMissingSignatures,
WarningFlag
Opt_WarnHiShadows,
WarningFlag
Opt_WarnOrphans,
WarningFlag
Opt_WarnUnusedDoBind,
WarningFlag
Opt_WarnTrustworthySafe,
WarningFlag
Opt_WarnUntickedPromotedConstructors,
WarningFlag
Opt_WarnMissingPatternSynonymSignatures
]
minusWeverythingOpts :: [WarningFlag]
minusWeverythingOpts :: [WarningFlag]
minusWeverythingOpts = [ Int -> WarningFlag
forall a. Enum a => Int -> a
toEnum 0 .. ]
minusWcompatOpts :: [WarningFlag]
minusWcompatOpts :: [WarningFlag]
minusWcompatOpts
= [ WarningFlag
Opt_WarnMissingMonadFailInstances
, WarningFlag
Opt_WarnSemigroup
, WarningFlag
Opt_WarnNonCanonicalMonoidInstances
, WarningFlag
Opt_WarnImplicitKindVars
, WarningFlag
Opt_WarnStarIsType
]
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
unusedBindsFlags :: [WarningFlag]
unusedBindsFlags :: [WarningFlag]
unusedBindsFlags = [ WarningFlag
Opt_WarnUnusedTopBinds
, WarningFlag
Opt_WarnUnusedLocalBinds
, WarningFlag
Opt_WarnUnusedPatternBinds
]
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 ]
foreign import ccall unsafe "rts_isProfiled" rtsIsProfiledIO :: IO CInt
rtsIsProfiled :: Bool
rtsIsProfiled :: Bool
rtsIsProfiled = IO CInt -> CInt
forall a. IO a -> a
unsafeDupablePerformIO IO CInt
rtsIsProfiledIO CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0
foreign import ccall unsafe "rts_isDynamic" rtsIsDynamicIO :: IO CInt
dynamicGhc :: Bool
dynamicGhc :: Bool
dynamicGhc = IO CInt -> CInt
forall a. IO a -> a
unsafeDupablePerformIO IO CInt
rtsIsDynamicIO CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0
setWarnSafe :: Bool -> DynP ()
setWarnSafe :: Bool -> DynP ()
setWarnSafe 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
>>= \l :: SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { warnSafeOnLoc :: SrcSpan
warnSafeOnLoc = SrcSpan
l })
setWarnSafe False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setWarnUnsafe :: Bool -> DynP ()
setWarnUnsafe :: Bool -> DynP ()
setWarnUnsafe 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
>>= \l :: SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { warnUnsafeOnLoc :: SrcSpan
warnUnsafeOnLoc = SrcSpan
l })
setWarnUnsafe 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
$ \d :: DynFlags
d -> DynFlags
d { pkgTrustOnLoc :: SrcSpan
pkgTrustOnLoc = SrcSpan
l }
setGenDeriving :: TurnOnFlag -> DynP ()
setGenDeriving :: Bool -> DynP ()
setGenDeriving 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
>>= \l :: SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { newDerivOnLoc :: SrcSpan
newDerivOnLoc = SrcSpan
l })
setGenDeriving False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setOverlappingInsts :: TurnOnFlag -> DynP ()
setOverlappingInsts :: Bool -> DynP ()
setOverlappingInsts False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setOverlappingInsts True = do
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
(DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { overlapInstLoc :: SrcSpan
overlapInstLoc = SrcSpan
l })
setIncoherentInsts :: TurnOnFlag -> DynP ()
setIncoherentInsts :: Bool -> DynP ()
setIncoherentInsts False = () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
setIncoherentInsts True = do
SrcSpan
l <- EwM (CmdLineP DynFlags) SrcSpan
forall (m :: * -> *). Monad m => EwM m SrcSpan
getCurLoc
(DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { incoherentOnLoc :: SrcSpan
incoherentOnLoc = SrcSpan
l })
checkTemplateHaskellOk :: TurnOnFlag -> DynP ()
checkTemplateHaskellOk :: Bool -> DynP ()
checkTemplateHaskellOk _turn_on :: 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
>>= \l :: SrcSpan
l -> (DynFlags -> DynFlags) -> DynP ()
upd (\d :: DynFlags
d -> DynFlags
d { thOnLoc :: SrcSpan
thOnLoc = SrcSpan
l })
type DynP = EwM (CmdLineP DynFlags)
upd :: (DynFlags -> DynFlags) -> DynP ()
upd :: (DynFlags -> DynFlags) -> DynP ()
upd f :: 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 f :: 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 fn :: 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 fn :: 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 fn :: 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 fn :: 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 fn :: Int -> DynFlags -> DynFlags
fn = (Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Int -> EwM m ()) -> OptKind m
IntSuffix (\n :: 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 fn :: Int -> DynFlags -> DynP DynFlags
fn = (Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Int -> EwM m ()) -> OptKind m
IntSuffix (\n :: Int
n -> (DynFlags -> DynP DynFlags) -> DynP ()
updM (Int -> DynFlags -> DynP DynFlags
fn Int
n))
floatSuffix :: (Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix :: (Float -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
floatSuffix fn :: Float -> DynFlags -> DynFlags
fn = (Float -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Float -> EwM m ()) -> OptKind m
FloatSuffix (\n :: 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 fn :: Maybe Int -> DynFlags -> DynP DynFlags
fn = (Maybe Int -> DynP ()) -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). (Maybe Int -> EwM m ()) -> OptKind m
OptIntSuffix (\mi :: 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 dump_flag :: DumpFlag
dump_flag = DynP () -> OptKind (CmdLineP DynFlags)
forall (m :: * -> *). EwM m () -> OptKind m
NoArg (DumpFlag -> DynP ()
setDumpFlag' DumpFlag
dump_flag)
addWay :: Way -> DynP ()
addWay :: Way -> DynP ()
addWay w :: Way
w = (DynFlags -> DynFlags) -> DynP ()
upd (Way -> DynFlags -> DynFlags
addWay' Way
w)
addWay' :: Way -> DynFlags -> DynFlags
addWay' :: Way -> DynFlags -> DynFlags
addWay' w :: Way
w dflags0 :: DynFlags
dflags0 = let platform :: Platform
platform = DynFlags -> Platform
targetPlatform DynFlags
dflags0
dflags1 :: DynFlags
dflags1 = DynFlags
dflags0 { ways :: [Way]
ways = Way
w Way -> [Way] -> [Way]
forall a. a -> [a] -> [a]
: DynFlags -> [Way]
ways 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 (\dfs :: DynFlags
dfs -> DynFlags
dfs { ways :: [Way]
ways = (Way -> Bool) -> [Way] -> [Way]
forall a. (a -> Bool) -> [a] -> [a]
filter (Way
WayDyn Way -> Way -> Bool
forall a. Eq a => a -> a -> Bool
/=) (DynFlags -> [Way]
ways DynFlags
dfs) })
setGeneralFlag, unSetGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag f :: GeneralFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' GeneralFlag
f)
unSetGeneralFlag :: GeneralFlag -> DynP ()
unSetGeneralFlag f :: GeneralFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (GeneralFlag -> DynFlags -> DynFlags
unSetGeneralFlag' GeneralFlag
f)
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' f :: GeneralFlag
f dflags :: 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
| (f' :: GeneralFlag
f', turn_on :: Bool
turn_on, d :: 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' f :: GeneralFlag
f dflags :: 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
| (f' :: GeneralFlag
f', turn_on :: Bool
turn_on, d :: 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 f :: WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_set DynFlags
dfs WarningFlag
f)
unSetWarningFlag :: WarningFlag -> DynP ()
unSetWarningFlag f :: WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_unset DynFlags
dfs WarningFlag
f)
setFatalWarningFlag, unSetFatalWarningFlag :: WarningFlag -> DynP ()
setFatalWarningFlag :: WarningFlag -> DynP ()
setFatalWarningFlag f :: WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_set_fatal DynFlags
dfs WarningFlag
f)
unSetFatalWarningFlag :: WarningFlag -> DynP ()
unSetFatalWarningFlag f :: WarningFlag
f = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags -> WarningFlag -> DynFlags
wopt_unset_fatal DynFlags
dfs WarningFlag
f)
setWErrorFlag :: WarningFlag -> DynP ()
setWErrorFlag :: WarningFlag -> DynP ()
setWErrorFlag flag :: WarningFlag
flag =
do { WarningFlag -> DynP ()
setWarningFlag WarningFlag
flag
; WarningFlag -> DynP ()
setFatalWarningFlag WarningFlag
flag }
setExtensionFlag, unSetExtensionFlag :: LangExt.Extension -> DynP ()
setExtensionFlag :: Extension -> DynP ()
setExtensionFlag f :: Extension
f = (DynFlags -> DynFlags) -> DynP ()
upd (Extension -> DynFlags -> DynFlags
setExtensionFlag' Extension
f)
unSetExtensionFlag :: Extension -> DynP ()
unSetExtensionFlag f :: Extension
f = (DynFlags -> DynFlags) -> DynP ()
upd (Extension -> DynFlags -> DynFlags
unSetExtensionFlag' Extension
f)
setExtensionFlag', unSetExtensionFlag' :: LangExt.Extension -> DynFlags -> DynFlags
setExtensionFlag' :: Extension -> DynFlags -> DynFlags
setExtensionFlag' f :: Extension
f dflags :: 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
| (f' :: Extension
f', turn_on :: Bool
turn_on, d :: 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' f :: Extension
f dflags :: DynFlags
dflags = DynFlags -> Extension -> DynFlags
xopt_unset DynFlags
dflags Extension
f
alterSettings :: (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings :: (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings f :: Settings -> Settings
f dflags :: DynFlags
dflags = DynFlags
dflags { settings :: Settings
settings = Settings -> Settings
f (DynFlags -> Settings
settings DynFlags
dflags) }
setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' dump_flag :: DumpFlag
dump_flag
= do (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: 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 dfs :: DynFlags
dfs = GhcMode -> Bool
isOneShot (DynFlags -> GhcMode
ghcMode DynFlags
dfs)
setVerboseCore2Core :: DynP ()
setVerboseCore2Core :: DynP ()
setVerboseCore2Core = DumpFlag -> DynP ()
setDumpFlag' DumpFlag
Opt_D_verbose_core2core
setVerbosity :: Maybe Int -> DynP ()
setVerbosity :: Maybe Int -> DynP ()
setVerbosity mb_n :: Maybe Int
mb_n = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags
dfs{ verbosity :: Int
verbosity = Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` 3 })
setDebugLevel :: Maybe Int -> DynP ()
setDebugLevel :: Maybe Int -> DynP ()
setDebugLevel mb_n :: Maybe Int
mb_n = (DynFlags -> DynFlags) -> DynP ()
upd (\dfs :: DynFlags
dfs -> DynFlags
dfs{ debugLevel :: Int
debugLevel = Maybe Int
mb_n Maybe Int -> Int -> Int
forall a. Maybe a -> a -> a
`orElse` 2 })
data PkgConfRef
= GlobalPkgConf
| UserPkgConf
| PkgConfFile FilePath
deriving PkgConfRef -> PkgConfRef -> Bool
(PkgConfRef -> PkgConfRef -> Bool)
-> (PkgConfRef -> PkgConfRef -> Bool) -> Eq PkgConfRef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PkgConfRef -> PkgConfRef -> Bool
$c/= :: PkgConfRef -> PkgConfRef -> Bool
== :: PkgConfRef -> PkgConfRef -> Bool
$c== :: PkgConfRef -> PkgConfRef -> Bool
Eq
addPkgConfRef :: PkgConfRef -> DynP ()
addPkgConfRef :: PkgConfRef -> DynP ()
addPkgConfRef p :: PkgConfRef
p = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \s :: DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PkgConfRef -> PackageDBFlag
PackageDB PkgConfRef
p PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
removeUserPkgConf :: DynP ()
removeUserPkgConf :: DynP ()
removeUserPkgConf = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \s :: DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PackageDBFlag
NoUserPackageDB PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
removeGlobalPkgConf :: DynP ()
removeGlobalPkgConf :: DynP ()
removeGlobalPkgConf = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \s :: DynFlags
s ->
DynFlags
s { packageDBFlags :: [PackageDBFlag]
packageDBFlags = PackageDBFlag
NoGlobalPackageDB PackageDBFlag -> [PackageDBFlag] -> [PackageDBFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageDBFlag]
packageDBFlags DynFlags
s }
clearPkgConf :: DynP ()
clearPkgConf :: DynP ()
clearPkgConf = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \s :: 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 flag :: String
flag arg_parse :: ReadP PackageArg
arg_parse str :: 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 -> 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
[(r :: PackageFlag
r, "")] -> PackageFlag
r
_ -> GhcException -> PackageFlag
forall a. GhcException -> a
throwGhcException (GhcException -> PackageFlag) -> GhcException -> PackageFlag
forall a b. (a -> b) -> a -> b
$ String -> GhcException
CmdLineError ("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 -> 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 "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 '('
[(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
_ <- 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 ')'
[(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 "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 m :: 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
>>= \x :: 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 p :: String
p = (DynFlags -> DynFlags) -> DynP ()
upd (String -> DynFlags -> DynFlags
exposePackage' String
p)
exposePackageId :: String -> DynP ()
exposePackageId p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: DynFlags
s -> DynFlags
s{ packageFlags :: [PackageFlag]
packageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag "-package-id" ReadP PackageArg
parseUnitIdArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
packageFlags DynFlags
s })
exposePluginPackage :: String -> DynP ()
exposePluginPackage p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: DynFlags
s -> DynFlags
s{ pluginPackageFlags :: [PackageFlag]
pluginPackageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag "-plugin-package" ReadP PackageArg
parsePackageArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
s })
exposePluginPackageId :: String -> DynP ()
exposePluginPackageId p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: DynFlags
s -> DynFlags
s{ pluginPackageFlags :: [PackageFlag]
pluginPackageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag "-plugin-package-id" ReadP PackageArg
parseUnitIdArg String
p PackageFlag -> [PackageFlag] -> [PackageFlag]
forall a. a -> [a] -> [a]
: DynFlags -> [PackageFlag]
pluginPackageFlags DynFlags
s })
hidePackage :: String -> DynP ()
hidePackage p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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 p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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 p :: 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 (\s :: 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 p :: 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 (\s :: 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' p :: String
p dflags :: DynFlags
dflags
= DynFlags
dflags { packageFlags :: [PackageFlag]
packageFlags =
String -> ReadP PackageArg -> String -> PackageFlag
parsePackageFlag "-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 (\c :: 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` ":-_."))
parseUnitIdArg :: ReadP PackageArg
parseUnitIdArg :: ReadP PackageArg
parseUnitIdArg =
(UnitId -> PackageArg) -> ReadP UnitId -> ReadP PackageArg
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap UnitId -> PackageArg
UnitIdArg ReadP UnitId
parseUnitId
setUnitId :: String -> DynFlags -> DynFlags
setUnitId :: String -> DynFlags -> DynFlags
setUnitId p :: String
p d :: DynFlags
d = DynFlags
d { thisInstalledUnitId :: InstalledUnitId
thisInstalledUnitId = String -> InstalledUnitId
stringToInstalledUnitId String
p }
canonicalizeHomeModule :: DynFlags -> ModuleName -> Module
canonicalizeHomeModule :: DynFlags -> ModuleName -> Module
canonicalizeHomeModule dflags :: DynFlags
dflags mod_name :: ModuleName
mod_name =
case ModuleName -> [(ModuleName, Module)] -> Maybe Module
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup ModuleName
mod_name (DynFlags -> [(ModuleName, Module)]
thisUnitIdInsts DynFlags
dflags) of
Nothing -> UnitId -> ModuleName -> Module
mkModule (DynFlags -> UnitId
thisPackage DynFlags
dflags) ModuleName
mod_name
Just mod :: Module
mod -> Module
mod
canonicalizeModuleIfHome :: DynFlags -> Module -> Module
canonicalizeModuleIfHome :: DynFlags -> Module -> Module
canonicalizeModuleIfHome dflags :: DynFlags
dflags mod :: Module
mod
= if DynFlags -> UnitId
thisPackage DynFlags
dflags UnitId -> UnitId -> Bool
forall a. Eq a => a -> a -> Bool
== Module -> UnitId
moduleUnitId Module
mod
then DynFlags -> ModuleName -> Module
canonicalizeHomeModule DynFlags
dflags (Module -> ModuleName
moduleName Module
mod)
else Module
mod
interpretPackageEnv :: DynFlags -> IO DynFlags
interpretPackageEnv :: DynFlags -> IO DynFlags
interpretPackageEnv dflags :: DynFlags
dflags = do
Maybe String
mPkgEnv <- MaybeT IO String -> IO (Maybe String)
forall (m :: * -> *) a. MaybeT m a -> m (Maybe a)
runMaybeT (MaybeT IO String -> IO (Maybe String))
-> MaybeT IO String -> IO (Maybe String)
forall a b. (a -> b) -> a -> b
$ [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
getCmdLineArg MaybeT IO String
-> (String -> MaybeT IO String) -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \env :: String
env -> [MaybeT IO String] -> MaybeT IO String
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, MonadPlus m) =>
t (m a) -> m a
msum [
String -> MaybeT IO String
probeNullEnv String
env
, String -> MaybeT IO String
probeEnvFile String
env
, String -> MaybeT IO String
probeEnvName String
env
, String -> MaybeT IO String
forall a. String -> MaybeT IO a
cmdLineError String
env
]
, MaybeT IO String
getEnvVar MaybeT IO String
-> (String -> MaybeT IO String) -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \env :: String
env -> [MaybeT IO String] -> MaybeT IO String
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, MonadPlus m) =>
t (m a) -> m a
msum [
String -> MaybeT IO String
probeNullEnv String
env
, String -> MaybeT IO String
probeEnvFile String
env
, String -> MaybeT IO String
probeEnvName String
env
, String -> MaybeT IO String
forall a. String -> MaybeT IO a
envError String
env
]
, MaybeT IO ()
notIfHideAllPackages MaybeT IO () -> MaybeT IO String -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> [MaybeT IO String] -> MaybeT IO String
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, MonadPlus m) =>
t (m a) -> m a
msum [
MaybeT IO String
findLocalEnvFile MaybeT IO String
-> (String -> MaybeT IO String) -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= String -> MaybeT IO String
probeEnvFile
, String -> MaybeT IO String
probeEnvName String
defaultEnvName
]
]
case Maybe String
mPkgEnv of
Nothing ->
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags
Just "-" -> do
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags
Just envfile :: String
envfile -> do
String
content <- String -> IO String
readFile String
envfile
LogAction
putLogMsg DynFlags
dflags WarnReason
NoReason Severity
SevInfo SrcSpan
noSrcSpan
(DynFlags -> PprStyle
defaultUserStyle DynFlags
dflags)
(String -> SDoc
text ("Loaded package environment from " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
envfile))
let setFlags :: DynP ()
setFlags :: DynP ()
setFlags = do
GeneralFlag -> DynP ()
setGeneralFlag GeneralFlag
Opt_HideAllPackages
String -> String -> DynP ()
parseEnvFile String
envfile String
content
(_, dflags' :: DynFlags
dflags') = CmdLineP DynFlags (Errs, Warns, ())
-> DynFlags -> ((Errs, Warns, ()), DynFlags)
forall s a. CmdLineP s a -> s -> (a, s)
runCmdLine (DynP () -> CmdLineP DynFlags (Errs, Warns, ())
forall (m :: * -> *) a. EwM m a -> m (Errs, Warns, a)
runEwM DynP ()
setFlags) DynFlags
dflags
DynFlags -> IO DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags'
where
namedEnvPath :: String -> MaybeT IO FilePath
namedEnvPath :: String -> MaybeT IO String
namedEnvPath name :: String
name = do
String
appdir <- DynFlags -> MaybeT IO String
versionedAppDir DynFlags
dflags
String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> MaybeT IO String) -> String -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ String
appdir String -> ShowS
</> "environments" String -> ShowS
</> String
name
probeEnvName :: String -> MaybeT IO FilePath
probeEnvName :: String -> MaybeT IO String
probeEnvName name :: String
name = String -> MaybeT IO String
probeEnvFile (String -> MaybeT IO String)
-> MaybeT IO String -> MaybeT IO String
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< String -> MaybeT IO String
namedEnvPath String
name
probeEnvFile :: FilePath -> MaybeT IO FilePath
probeEnvFile :: String -> MaybeT IO String
probeEnvFile path :: String
path = do
Bool -> MaybeT IO ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Bool -> MaybeT IO ()) -> MaybeT IO Bool -> MaybeT IO ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< IO Bool -> MaybeT IO Bool
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (String -> IO Bool
doesFileExist String
path)
String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
path
probeNullEnv :: FilePath -> MaybeT IO FilePath
probeNullEnv :: String -> MaybeT IO String
probeNullEnv "-" = String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return "-"
probeNullEnv _ = MaybeT IO String
forall (m :: * -> *) a. MonadPlus m => m a
mzero
parseEnvFile :: FilePath -> String -> DynP ()
parseEnvFile :: String -> String -> DynP ()
parseEnvFile envfile :: 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 str :: String
str = case String -> [String]
words String
str of
("package-db": _) -> PkgConfRef -> DynP ()
addPkgConfRef (String -> PkgConfRef
PkgConfFile (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 11 String
str
["clear-package-db"] -> DynP ()
clearPkgConf
["global-package-db"] -> PkgConfRef -> DynP ()
addPkgConfRef PkgConfRef
GlobalPkgConf
["user-package-db"] -> PkgConfRef -> DynP ()
addPkgConfRef PkgConfRef
UserPkgConf
["package-id", pkgid :: String
pkgid] -> String -> DynP ()
exposePackageId String
pkgid
(('-':'-':_):_) -> () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
[pkgid :: String
pkgid] -> String -> DynP ()
exposePackageId String
pkgid
[] -> () -> DynP ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
_ -> 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
$
"Can't parse environment file entry: "
String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
envfile String -> ShowS
forall a. [a] -> [a] -> [a]
++ ": " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str
getCmdLineArg :: MaybeT IO String
getCmdLineArg :: MaybeT IO String
getCmdLineArg = IO (Maybe String) -> MaybeT IO String
forall (m :: * -> *) a. m (Maybe a) -> MaybeT m a
MaybeT (IO (Maybe String) -> MaybeT IO String)
-> IO (Maybe String) -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ Maybe String -> IO (Maybe String)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe String -> IO (Maybe String))
-> Maybe String -> IO (Maybe String)
forall a b. (a -> b) -> a -> b
$ DynFlags -> Maybe String
packageEnv DynFlags
dflags
getEnvVar :: MaybeT IO String
getEnvVar :: MaybeT IO String
getEnvVar = do
Either IOError String
mvar <- IO (Either IOError String) -> MaybeT IO (Either IOError String)
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (IO (Either IOError String) -> MaybeT IO (Either IOError String))
-> IO (Either IOError String) -> MaybeT IO (Either IOError String)
forall a b. (a -> b) -> a -> b
$ IO String -> IO (Either IOError String)
forall e a. Exception e => IO a -> IO (Either e a)
try (IO String -> IO (Either IOError String))
-> IO String -> IO (Either IOError String)
forall a b. (a -> b) -> a -> b
$ String -> IO String
getEnv "GHC_ENVIRONMENT"
case Either IOError String
mvar of
Right var :: String
var -> String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
var
Left err :: IOError
err -> if IOError -> Bool
isDoesNotExistError IOError
err then MaybeT IO String
forall (m :: * -> *) a. MonadPlus m => m a
mzero
else IO String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (IO String -> MaybeT IO String) -> IO String -> MaybeT IO String
forall a b. (a -> b) -> a -> b
$ IOError -> IO String
forall e a. Exception e => e -> IO a
throwIO IOError
err
notIfHideAllPackages :: MaybeT IO ()
notIfHideAllPackages :: MaybeT IO ()
notIfHideAllPackages =
Bool -> MaybeT IO ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_HideAllPackages DynFlags
dflags))
defaultEnvName :: String
defaultEnvName :: String
defaultEnvName = "default"
localEnvFileName :: FilePath
localEnvFileName :: String
localEnvFileName = ".ghc.environment" String -> ShowS
<.> DynFlags -> String
versionedFilePath DynFlags
dflags
findLocalEnvFile :: MaybeT IO FilePath
findLocalEnvFile :: MaybeT IO String
findLocalEnvFile = do
String
curdir <- IO String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT IO String
getCurrentDirectory
String
homedir <- IO String -> MaybeT IO String
forall a. IO a -> MaybeT IO a
tryMaybeT IO String
getHomeDirectory
let probe :: String -> MaybeT IO String
probe dir :: String
dir | String -> Bool
isDrive String
dir Bool -> Bool -> Bool
|| String
dir String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
homedir
= MaybeT IO String
forall (m :: * -> *) a. MonadPlus m => m a
mzero
probe dir :: String
dir = do
let file :: String
file = String
dir String -> ShowS
</> String
localEnvFileName
Bool
exists <- IO Bool -> MaybeT IO Bool
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (String -> IO Bool
doesFileExist String
file)
if Bool
exists
then String -> MaybeT IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
file
else String -> MaybeT IO String
probe (ShowS
takeDirectory String
dir)
String -> MaybeT IO String
probe String
curdir
cmdLineError :: String -> MaybeT IO a
cmdLineError :: String -> MaybeT IO a
cmdLineError env :: String
env = IO a -> MaybeT IO a
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (IO a -> MaybeT IO a) -> (String -> IO a) -> String -> MaybeT IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GhcException -> IO a
forall a. GhcException -> IO a
throwGhcExceptionIO (GhcException -> IO a)
-> (String -> GhcException) -> String -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> GhcException
CmdLineError (String -> MaybeT IO a) -> String -> MaybeT IO a
forall a b. (a -> b) -> a -> b
$
"Package environment " String -> ShowS
forall a. [a] -> [a] -> [a]
++ ShowS
forall a. Show a => a -> String
show String
env String -> ShowS
forall a. [a] -> [a] -> [a]
++ " not found"
envError :: String -> MaybeT IO a
envError :: String -> MaybeT IO a
envError env :: String
env = IO a -> MaybeT IO a
forall (m :: * -> *) a. Monad m => m a -> MaybeT m a
liftMaybeT (IO a -> MaybeT IO a) -> (String -> IO a) -> String -> MaybeT IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GhcException -> IO a
forall a. GhcException -> IO a
throwGhcExceptionIO (GhcException -> IO a)
-> (String -> GhcException) -> String -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> GhcException
CmdLineError (String -> MaybeT IO a) -> String -> MaybeT IO a
forall a b. (a -> b) -> a -> b
$
"Package environment "
String -> ShowS
forall a. [a] -> [a] -> [a]
++ ShowS
forall a. Show a => a -> String
show String
env
String -> ShowS
forall a. [a] -> [a] -> [a]
++ " (specified in GHC_ENVIRONMENT) not found"
setTarget :: HscTarget -> DynP ()
setTarget :: HscTarget -> DynP ()
setTarget l :: HscTarget
l = (Platform -> HscTarget) -> DynP ()
setTargetWithPlatform (HscTarget -> Platform -> HscTarget
forall a b. a -> b -> a
const HscTarget
l)
setTargetWithPlatform :: (Platform -> HscTarget) -> DynP ()
setTargetWithPlatform :: (Platform -> HscTarget) -> DynP ()
setTargetWithPlatform f :: Platform -> HscTarget
f = (DynFlags -> DynFlags) -> DynP ()
upd DynFlags -> DynFlags
set
where
set :: DynFlags -> DynFlags
set dfs :: DynFlags
dfs = let l :: HscTarget
l = Platform -> HscTarget
f (DynFlags -> Platform
targetPlatform DynFlags
dfs)
in if DynFlags -> GhcLink
ghcLink DynFlags
dfs GhcLink -> GhcLink -> Bool
forall a. Eq a => a -> a -> Bool
/= GhcLink
LinkBinary Bool -> Bool -> Bool
|| HscTarget -> Bool
isObjectTarget HscTarget
l
then DynFlags
dfs{ hscTarget :: HscTarget
hscTarget = HscTarget
l }
else DynFlags
dfs
setObjTarget :: HscTarget -> DynP ()
setObjTarget :: HscTarget -> DynP ()
setObjTarget l :: HscTarget
l = (DynFlags -> DynP DynFlags) -> DynP ()
updM DynFlags -> DynP DynFlags
forall (m :: * -> *). Monad m => DynFlags -> m DynFlags
set
where
set :: DynFlags -> m DynFlags
set dflags :: DynFlags
dflags
| HscTarget -> Bool
isObjectTarget (DynFlags -> HscTarget
hscTarget DynFlags
dflags)
= DynFlags -> m DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (DynFlags -> m DynFlags) -> DynFlags -> m DynFlags
forall a b. (a -> b) -> a -> b
$ DynFlags
dflags { hscTarget :: HscTarget
hscTarget = HscTarget
l }
| Bool
otherwise = DynFlags -> m DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return DynFlags
dflags
setOptLevel :: Int -> DynFlags -> DynP DynFlags
setOptLevel :: Int -> DynFlags -> DynP DynFlags
setOptLevel n :: Int
n dflags :: DynFlags
dflags = DynFlags -> DynP DynFlags
forall (m :: * -> *) a. Monad m => a -> m a
return (Int -> DynFlags -> DynFlags
updOptLevel Int
n DynFlags
dflags)
checkOptLevel :: Int -> DynFlags -> Either String DynFlags
checkOptLevel :: Int -> DynFlags -> Either String DynFlags
checkOptLevel n :: Int
n dflags :: DynFlags
dflags
| DynFlags -> HscTarget
hscTarget DynFlags
dflags HscTarget -> HscTarget -> Bool
forall a. Eq a => a -> a -> Bool
== HscTarget
HscInterpreted Bool -> Bool -> Bool
&& Int
n Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> 0
= String -> Either String DynFlags
forall a b. a -> Either a b
Left "-O conflicts with --interactive; -O ignored."
| Bool
otherwise
= DynFlags -> Either String DynFlags
forall a b. b -> Either a b
Right DynFlags
dflags
setMainIs :: String -> DynP ()
setMainIs :: String -> DynP ()
setMainIs arg :: 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
$ \d :: DynFlags
d -> DynFlags
d { mainFunIs :: Maybe String
mainFunIs = String -> Maybe String
forall a. a -> Maybe a
Just String
main_fn,
mainModIs :: Module
mainModIs = UnitId -> ModuleName -> Module
mkModule UnitId
mainUnitId (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
$ \d :: DynFlags
d -> DynFlags
d { mainModIs :: Module
mainModIs = UnitId -> ModuleName -> Module
mkModule UnitId
mainUnitId (String -> ModuleName
mkModuleName String
arg) }
| Bool
otherwise
= (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \d :: DynFlags
d -> DynFlags
d { mainFunIs :: Maybe String
mainFunIs = String -> Maybe String
forall a. a -> Maybe a
Just String
arg }
where
(main_mod :: String
main_mod, main_fn :: String
main_fn) = String -> (Char -> Bool) -> (String, String)
splitLongestPrefix String
arg (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== '.')
addLdInputs :: Option -> DynFlags -> DynFlags
addLdInputs :: Option -> DynFlags -> DynFlags
addLdInputs p :: Option
p dflags :: DynFlags
dflags = DynFlags
dflags{ldInputs :: [Option]
ldInputs = DynFlags -> [Option]
ldInputs DynFlags
dflags [Option] -> [Option] -> [Option]
forall a. [a] -> [a] -> [a]
++ [Option
p]}
addImportPath, addLibraryPath, addIncludePath, addFrameworkPath :: FilePath -> DynP ()
addImportPath :: String -> DynP ()
addImportPath "" = (DynFlags -> DynFlags) -> DynP ()
upd (\s :: DynFlags
s -> DynFlags
s{importPaths :: [String]
importPaths = []})
addImportPath p :: String
p = (DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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 p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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 p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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 p :: String
p =
(DynFlags -> DynFlags) -> DynP ()
upd (\s :: 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_TARGET_OS)
split_marker :: Char
split_marker :: Char
split_marker = ':'
#endif
splitPathList :: String -> [String]
splitPathList :: String -> [String]
splitPathList s :: String
s = (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter String -> Bool
forall a. [a] -> Bool
notNull (String -> [String]
splitUp String
s)
where
#if !defined(mingw32_TARGET_OS)
splitUp :: String -> [String]
splitUp xs :: 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 dir :: String
dir = (Settings -> Settings) -> DynFlags -> DynFlags
alterSettings (\s :: Settings
s -> Settings
s { sTmpDir :: String
sTmpDir = ShowS
normalise String
dir })
setRtsOpts :: String -> DynP ()
setRtsOpts :: String -> DynP ()
setRtsOpts arg :: String
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ d :: 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 arg :: RtsOptsEnabled
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ d :: DynFlags
d -> DynFlags
d {rtsOptsEnabled :: RtsOptsEnabled
rtsOptsEnabled = RtsOptsEnabled
arg}
setOptHpcDir :: String -> DynP ()
setOptHpcDir :: String -> DynP ()
setOptHpcDir arg :: String
arg = (DynFlags -> DynFlags) -> DynP ()
upd ((DynFlags -> DynFlags) -> DynP ())
-> (DynFlags -> DynFlags) -> DynP ()
forall a b. (a -> b) -> a -> b
$ \ d :: DynFlags
d -> DynFlags
d {hpcDir :: String
hpcDir = String
arg}
picCCOpts :: DynFlags -> [String]
picCCOpts :: DynFlags -> [String]
picCCOpts dflags :: DynFlags
dflags = [String]
pieOpts [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
picOpts
where
picOpts :: [String]
picOpts =
case Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
OSDarwin
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags -> ["-fno-common", "-U__PIC__", "-D__PIC__"]
| Bool
otherwise -> ["-mdynamic-no-pic"]
OSMinGW32
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags -> ["-U__PIC__", "-D__PIC__"]
| Bool
otherwise -> []
_
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags Bool -> Bool -> Bool
|| Way
WayDyn Way -> [Way] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` DynFlags -> [Way]
ways DynFlags
dflags ->
["-fPIC", "-U__PIC__", "-D__PIC__"]
| Bool
otherwise -> ["-fno-PIC"]
pieOpts :: [String]
pieOpts
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PICExecutable DynFlags
dflags = ["-pie"]
| Settings -> Bool
sGccSupportsNoPie (DynFlags -> Settings
settings DynFlags
dflags) = ["-no-pie"]
| Bool
otherwise = []
picPOpts :: DynFlags -> [String]
picPOpts :: DynFlags -> [String]
picPOpts dflags :: DynFlags
dflags
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_PIC DynFlags
dflags = ["-U__PIC__", "-D__PIC__"]
| Bool
otherwise = []
can_split :: Bool
can_split :: Bool
can_split = String
cSupportsSplitObjs String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
compilerInfo :: DynFlags -> [(String, String)]
compilerInfo :: DynFlags -> [(String, String)]
compilerInfo dflags :: DynFlags
dflags
=
("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]
++ [("Project version", DynFlags -> String
projectVersion DynFlags
dflags),
("Project Git commit id", String
cProjectGitCommitId),
("Booter version", String
cBooterVersion),
("Stage", String
cStage),
("Build platform", String
cBuildPlatformString),
("Host platform", String
cHostPlatformString),
("Target platform", String
cTargetPlatformString),
("Have interpreter", String
cGhcWithInterpreter),
("Object splitting supported", String
cSupportsSplitObjs),
("Have native code generator", String
cGhcWithNativeCodeGen),
("Support SMP", String
cGhcWithSMP),
("Tables next to code", String
cGhcEnableTablesNextToCode),
("RTS ways", String
cGhcRTSWays),
("RTS expects libdw", Bool -> String
showBool Bool
cGhcRtsWithLibdw),
("Support dynamic-too", Bool -> String
showBool (Bool -> String) -> Bool -> String
forall a b. (a -> b) -> a -> b
$ Bool -> Bool
not Bool
isWindows),
("Support parallel --make", "YES"),
("Support reexported-modules", "YES"),
("Support thinning and renaming package flags", "YES"),
("Support Backpack", "YES"),
("Requires unified installed package IDs", "YES"),
("Uses package keys", "YES"),
("Uses unit IDs", "YES"),
("Dynamic by default", Bool -> String
showBool (Bool -> String) -> Bool -> String
forall a b. (a -> b) -> a -> b
$ DynFlags -> Bool
dYNAMIC_BY_DEFAULT DynFlags
dflags),
("GHC Dynamic", Bool -> String
showBool Bool
dynamicGhc),
("GHC Profiled", Bool -> String
showBool Bool
rtsIsProfiled),
("Leading underscore", String
cLeadingUnderscore),
("Debug on", Bool -> String
forall a. Show a => a -> String
show Bool
debugIsOn),
("LibDir", DynFlags -> String
topDir DynFlags
dflags),
("Global Package DB", DynFlags -> String
systemPackageConfig DynFlags
dflags)
]
where
showBool :: Bool -> String
showBool True = "YES"
showBool False = "NO"
isWindows :: Bool
isWindows = Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags) OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32
expandDirectories :: FilePath -> Maybe FilePath -> String -> String
expandDirectories :: String -> Maybe String -> ShowS
expandDirectories topd :: String
topd mtoold :: Maybe String
mtoold = Maybe String -> ShowS
expandToolDir Maybe String
mtoold ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
expandTopDir String
topd
#include "GHCConstantsHaskellWrappers.hs"
bLOCK_SIZE_W :: DynFlags -> Int
bLOCK_SIZE_W :: DynFlags -> Int
bLOCK_SIZE_W dflags :: DynFlags
dflags = DynFlags -> Int
bLOCK_SIZE DynFlags
dflags Int -> Int -> Int
forall a. Integral a => a -> a -> a
`quot` DynFlags -> Int
wORD_SIZE DynFlags
dflags
wORD_SIZE_IN_BITS :: DynFlags -> Int
wORD_SIZE_IN_BITS :: DynFlags -> Int
wORD_SIZE_IN_BITS dflags :: DynFlags
dflags = DynFlags -> Int
wORD_SIZE DynFlags
dflags Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8
tAG_MASK :: DynFlags -> Int
tAG_MASK :: DynFlags -> Int
tAG_MASK dflags :: DynFlags
dflags = (1 Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftL` DynFlags -> Int
tAG_BITS DynFlags
dflags) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1
mAX_PTR_TAG :: DynFlags -> Int
mAX_PTR_TAG :: DynFlags -> Int
mAX_PTR_TAG = DynFlags -> Int
tAG_MASK
tARGET_MIN_INT, tARGET_MAX_INT, tARGET_MAX_WORD :: DynFlags -> Integer
tARGET_MIN_INT :: DynFlags -> Integer
tARGET_MIN_INT dflags :: DynFlags
dflags
= case Platform -> Int
platformWordSize (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
4 -> Int32 -> Integer
forall a. Integral a => a -> Integer
toInteger (Int32
forall a. Bounded a => a
minBound :: Int32)
8 -> Int64 -> Integer
forall a. Integral a => a -> Integer
toInteger (Int64
forall a. Bounded a => a
minBound :: Int64)
w :: Int
w -> String -> Integer
forall a. String -> a
panic ("tARGET_MIN_INT: Unknown platformWordSize: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
w)
tARGET_MAX_INT :: DynFlags -> Integer
tARGET_MAX_INT dflags :: DynFlags
dflags
= case Platform -> Int
platformWordSize (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
4 -> Int32 -> Integer
forall a. Integral a => a -> Integer
toInteger (Int32
forall a. Bounded a => a
maxBound :: Int32)
8 -> Int64 -> Integer
forall a. Integral a => a -> Integer
toInteger (Int64
forall a. Bounded a => a
maxBound :: Int64)
w :: Int
w -> String -> Integer
forall a. String -> a
panic ("tARGET_MAX_INT: Unknown platformWordSize: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
w)
tARGET_MAX_WORD :: DynFlags -> Integer
tARGET_MAX_WORD dflags :: DynFlags
dflags
= case Platform -> Int
platformWordSize (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
4 -> Word32 -> Integer
forall a. Integral a => a -> Integer
toInteger (Word32
forall a. Bounded a => a
maxBound :: Word32)
8 -> Word64 -> Integer
forall a. Integral a => a -> Integer
toInteger (Word64
forall a. Bounded a => a
maxBound :: Word64)
w :: Int
w -> String -> Integer
forall a. String -> a
panic ("tARGET_MAX_WORD: Unknown platformWordSize: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
w)
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent dflags :: 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 = "-dynamic-too is not supported on Windows"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| DynFlags -> HscTarget
hscTarget DynFlags
dflags HscTarget -> HscTarget -> Bool
forall a. Eq a => a -> a -> Bool
== HscTarget
HscC Bool -> Bool -> Bool
&&
Bool -> Bool
not (Platform -> Bool
platformUnregisterised (DynFlags -> Platform
targetPlatform DynFlags
dflags))
= if String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
then let dflags' :: DynFlags
dflags' = DynFlags
dflags { hscTarget :: HscTarget
hscTarget = HscTarget
HscAsm }
warn :: String
warn = "Compiler not unregisterised, so using native code generator rather than compiling via C"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
else let dflags' :: DynFlags
dflags' = DynFlags
dflags { hscTarget :: HscTarget
hscTarget = HscTarget
HscLlvm }
warn :: String
warn = "Compiler not unregisterised, so using LLVM rather than compiling via C"
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_Hpc DynFlags
dflags Bool -> Bool -> Bool
&& DynFlags -> HscTarget
hscTarget DynFlags
dflags HscTarget -> HscTarget -> Bool
forall a. Eq a => a -> a -> Bool
== HscTarget
HscInterpreted
= let dflags' :: DynFlags
dflags' = DynFlags -> GeneralFlag -> DynFlags
gopt_unset DynFlags
dflags GeneralFlag
Opt_Hpc
warn :: String
warn = "Hpc can't be used with byte-code interpreter. Ignoring -fhpc."
in DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags' String
warn
| DynFlags -> HscTarget
hscTarget DynFlags
dflags HscTarget -> [HscTarget] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [HscTarget
HscAsm, HscTarget
HscLlvm] Bool -> Bool -> Bool
&&
Platform -> Bool
platformUnregisterised (DynFlags -> Platform
targetPlatform DynFlags
dflags)
= DynFlags -> String -> (DynFlags, [Located String])
loop (DynFlags
dflags { hscTarget :: HscTarget
hscTarget = HscTarget
HscC })
"Compiler unregisterised, so compiling via C"
| DynFlags -> HscTarget
hscTarget DynFlags
dflags HscTarget -> HscTarget -> Bool
forall a. Eq a => a -> a -> Bool
== HscTarget
HscAsm Bool -> Bool -> Bool
&&
String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
/= "YES"
= let dflags' :: DynFlags
dflags' = DynFlags
dflags { hscTarget :: HscTarget
hscTarget = HscTarget
HscLlvm }
warn :: String
warn = "No native code generator, 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)
"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)
"Enabling -fPIC as it is always on for this platform"
| Left err :: String
err <- Int -> DynFlags -> Either String DynFlags
checkOptLevel (DynFlags -> Int
optLevel DynFlags
dflags) DynFlags
dflags
= DynFlags -> String -> (DynFlags, [Located String])
loop (Int -> DynFlags -> DynFlags
updOptLevel 0 DynFlags
dflags) String
err
| GhcLink
LinkInMemory <- DynFlags -> GhcLink
ghcLink DynFlags
dflags
, Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalInterpreter DynFlags
dflags)
, Bool
rtsIsProfiled
, HscTarget -> Bool
isObjectTarget (DynFlags -> HscTarget
hscTarget DynFlags
dflags)
, Way
WayProf Way -> [Way] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` DynFlags -> [Way]
ways DynFlags
dflags
= DynFlags -> String -> (DynFlags, [Located String])
loop DynFlags
dflags{ways :: [Way]
ways = Way
WayProf Way -> [Way] -> [Way]
forall a. a -> [a] -> [a]
: DynFlags -> [Way]
ways DynFlags
dflags}
"Enabling -prof, because -fobject-code is enabled and GHCi is profiled"
| Bool
otherwise = (DynFlags
dflags, [])
where loc :: SrcSpan
loc = FastString -> SrcSpan
mkGeneralSrcSpan (String -> FastString
fsLit "when making flags consistent")
loop :: DynFlags -> String -> (DynFlags, [Located String])
loop updated_dflags :: DynFlags
updated_dflags warning :: String
warning
= case DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent DynFlags
updated_dflags of
(dflags' :: DynFlags
dflags', ws :: [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
defaultGlobalDynFlags :: DynFlags
defaultGlobalDynFlags :: DynFlags
defaultGlobalDynFlags =
(Settings -> LlvmConfig -> DynFlags
defaultDynFlags Settings
forall a. a
settings (LlvmTargets
forall a. a
llvmTargets, LlvmPasses
forall a. a
llvmPasses)) { verbosity :: Int
verbosity = 2 }
where
settings :: a
settings = String -> a
forall a. String -> a
panic "v_unsafeGlobalDynFlags: settings not initialised"
llvmTargets :: a
llvmTargets = String -> a
forall a. String -> a
panic "v_unsafeGlobalDynFlags: llvmTargets not initialised"
llvmPasses :: a
llvmPasses = String -> a
forall a. String -> a
panic "v_unsafeGlobalDynFlags: llvmPasses not initialised"
#if STAGE < 2
GLOBAL_VAR(v_unsafeGlobalDynFlags, defaultGlobalDynFlags, DynFlags)
#else
SHARED_GLOBAL_VAR( v_unsafeGlobalDynFlags
, getOrSetLibHSghcGlobalDynFlags
, "getOrSetLibHSghcGlobalDynFlags"
, defaultGlobalDynFlags
, DynFlags )
#endif
unsafeGlobalDynFlags :: DynFlags
unsafeGlobalDynFlags :: DynFlags
unsafeGlobalDynFlags = IO DynFlags -> DynFlags
forall a. IO a -> a
unsafePerformIO (IO DynFlags -> DynFlags) -> IO DynFlags -> DynFlags
forall a b. (a -> b) -> a -> b
$ IORef DynFlags -> IO DynFlags
forall a. IORef a -> IO a
readIORef IORef DynFlags
v_unsafeGlobalDynFlags
setUnsafeGlobalDynFlags :: DynFlags -> IO ()
setUnsafeGlobalDynFlags :: DynFlags -> IO ()
setUnsafeGlobalDynFlags = IORef DynFlags -> DynFlags -> IO ()
forall a. IORef a -> a -> IO ()
writeIORef IORef DynFlags
v_unsafeGlobalDynFlags
data SseVersion = SSE1
| SSE2
| SSE3
| SSE4
| SSE42
deriving (SseVersion -> SseVersion -> Bool
(SseVersion -> SseVersion -> Bool)
-> (SseVersion -> SseVersion -> Bool) -> Eq SseVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SseVersion -> SseVersion -> Bool
$c/= :: SseVersion -> SseVersion -> Bool
== :: SseVersion -> SseVersion -> Bool
$c== :: SseVersion -> SseVersion -> Bool
Eq, Eq SseVersion
Eq SseVersion =>
(SseVersion -> SseVersion -> Ordering)
-> (SseVersion -> SseVersion -> Bool)
-> (SseVersion -> SseVersion -> Bool)
-> (SseVersion -> SseVersion -> Bool)
-> (SseVersion -> SseVersion -> Bool)
-> (SseVersion -> SseVersion -> SseVersion)
-> (SseVersion -> SseVersion -> SseVersion)
-> Ord SseVersion
SseVersion -> SseVersion -> Bool
SseVersion -> SseVersion -> Ordering
SseVersion -> SseVersion -> SseVersion
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 :: SseVersion -> SseVersion -> SseVersion
$cmin :: SseVersion -> SseVersion -> SseVersion
max :: SseVersion -> SseVersion -> SseVersion
$cmax :: SseVersion -> SseVersion -> SseVersion
>= :: SseVersion -> SseVersion -> Bool
$c>= :: SseVersion -> SseVersion -> Bool
> :: SseVersion -> SseVersion -> Bool
$c> :: SseVersion -> SseVersion -> Bool
<= :: SseVersion -> SseVersion -> Bool
$c<= :: SseVersion -> SseVersion -> Bool
< :: SseVersion -> SseVersion -> Bool
$c< :: SseVersion -> SseVersion -> Bool
compare :: SseVersion -> SseVersion -> Ordering
$ccompare :: SseVersion -> SseVersion -> Ordering
$cp1Ord :: Eq SseVersion
Ord)
isSseEnabled :: DynFlags -> Bool
isSseEnabled :: DynFlags -> Bool
isSseEnabled dflags :: DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
ArchX86_64 -> Bool
True
ArchX86 -> 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
SSE1
_ -> Bool
False
isSse2Enabled :: DynFlags -> Bool
isSse2Enabled :: DynFlags -> Bool
isSse2Enabled dflags :: DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
ArchX86_64 ->
Bool
True
ArchX86 -> 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
SSE2
_ -> Bool
False
isSse4_2Enabled :: DynFlags -> Bool
isSse4_2Enabled :: DynFlags -> Bool
isSse4_2Enabled dflags :: 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 dflags :: 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 dflags :: DynFlags
dflags = DynFlags -> Bool
avx2 DynFlags
dflags Bool -> Bool -> Bool
|| DynFlags -> Bool
avx512f DynFlags
dflags
isAvx512cdEnabled :: DynFlags -> Bool
isAvx512cdEnabled :: DynFlags -> Bool
isAvx512cdEnabled dflags :: DynFlags
dflags = DynFlags -> Bool
avx512cd DynFlags
dflags
isAvx512erEnabled :: DynFlags -> Bool
isAvx512erEnabled :: DynFlags -> Bool
isAvx512erEnabled dflags :: DynFlags
dflags = DynFlags -> Bool
avx512er DynFlags
dflags
isAvx512fEnabled :: DynFlags -> Bool
isAvx512fEnabled :: DynFlags -> Bool
isAvx512fEnabled dflags :: DynFlags
dflags = DynFlags -> Bool
avx512f DynFlags
dflags
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512pfEnabled dflags :: DynFlags
dflags = DynFlags -> Bool
avx512pf DynFlags
dflags
data BmiVersion = BMI1
| BMI2
deriving (BmiVersion -> BmiVersion -> Bool
(BmiVersion -> BmiVersion -> Bool)
-> (BmiVersion -> BmiVersion -> Bool) -> Eq BmiVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BmiVersion -> BmiVersion -> Bool
$c/= :: BmiVersion -> BmiVersion -> Bool
== :: BmiVersion -> BmiVersion -> Bool
$c== :: BmiVersion -> BmiVersion -> Bool
Eq, Eq BmiVersion
Eq BmiVersion =>
(BmiVersion -> BmiVersion -> Ordering)
-> (BmiVersion -> BmiVersion -> Bool)
-> (BmiVersion -> BmiVersion -> Bool)
-> (BmiVersion -> BmiVersion -> Bool)
-> (BmiVersion -> BmiVersion -> Bool)
-> (BmiVersion -> BmiVersion -> BmiVersion)
-> (BmiVersion -> BmiVersion -> BmiVersion)
-> Ord BmiVersion
BmiVersion -> BmiVersion -> Bool
BmiVersion -> BmiVersion -> Ordering
BmiVersion -> BmiVersion -> BmiVersion
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 :: BmiVersion -> BmiVersion -> BmiVersion
$cmin :: BmiVersion -> BmiVersion -> BmiVersion
max :: BmiVersion -> BmiVersion -> BmiVersion
$cmax :: BmiVersion -> BmiVersion -> BmiVersion
>= :: BmiVersion -> BmiVersion -> Bool
$c>= :: BmiVersion -> BmiVersion -> Bool
> :: BmiVersion -> BmiVersion -> Bool
$c> :: BmiVersion -> BmiVersion -> Bool
<= :: BmiVersion -> BmiVersion -> Bool
$c<= :: BmiVersion -> BmiVersion -> Bool
< :: BmiVersion -> BmiVersion -> Bool
$c< :: BmiVersion -> BmiVersion -> Bool
compare :: BmiVersion -> BmiVersion -> Ordering
$ccompare :: BmiVersion -> BmiVersion -> Ordering
$cp1Ord :: Eq BmiVersion
Ord)
isBmiEnabled :: DynFlags -> Bool
isBmiEnabled :: DynFlags -> Bool
isBmiEnabled dflags :: DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
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
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
_ -> Bool
False
isBmi2Enabled :: DynFlags -> Bool
isBmi2Enabled :: DynFlags -> Bool
isBmi2Enabled dflags :: DynFlags
dflags = case Platform -> Arch
platformArch (DynFlags -> Platform
targetPlatform DynFlags
dflags) of
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
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
_ -> Bool
False
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
decodeSize :: String -> Integer
decodeSize :: String -> Integer
decodeSize str :: String
str
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "" = 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
== "K" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "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
* 1000)
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "M" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "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
* 1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* 1000)
| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "G" Bool -> Bool -> Bool
|| String
c String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "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
* 1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* 1000 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* 1000)
| Bool
otherwise = GhcException -> Integer
forall a. GhcException -> a
throwGhcException (String -> GhcException
CmdLineError ("can't decode size: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str))
where (m :: String
m, c :: 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 c :: Char
c = Char -> Bool
isDigit Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== '.'
foreign import ccall unsafe "setHeapSize" setHeapSize :: Int -> IO ()
foreign import ccall unsafe "enableTimingStats" enableTimingStats :: IO ()
data FilesToClean = FilesToClean {
FilesToClean -> Set String
ftcGhcSession :: !(Set FilePath),
FilesToClean -> Set String
ftcCurrentModule :: !(Set FilePath)
}
emptyFilesToClean :: FilesToClean
emptyFilesToClean :: FilesToClean
emptyFilesToClean = Set String -> Set String -> FilesToClean
FilesToClean Set String
forall a. Set a
Set.empty Set String
forall a. Set a
Set.empty