lopt_set_flattened,
lopt_unset_flattened,
DynFlags(..),
+ RtsOptsEnabled(..),
HscTarget(..), isObjectTarget, defaultObjectTarget,
GhcMode(..), isOneShot,
GhcLink(..), isNoLink,
| Opt_EagerBlackHoling
| Opt_ReadUserPackageConf
| Opt_NoHsMain
- | Opt_RtsOptsEnabled
| Opt_SplitObjs
| Opt_StgStats
| Opt_HideAllPackages
| Opt_GADTs
| Opt_RelaxedPolyRec
| Opt_NPlusKPatterns
+ | Opt_DoAndIfThenElse
| Opt_StandaloneDeriving
| Opt_DeriveDataTypeable
ghcUsagePath :: FilePath, -- Filled in by SysTools
ghciUsagePath :: FilePath, -- ditto
rtsOpts :: Maybe String,
+ rtsOptsEnabled :: RtsOptsEnabled,
hpcDir :: String, -- ^ Path to store the .mix files
| SystemDependent
deriving Eq
+data RtsOptsEnabled = RtsOptsNone | RtsOptsSafeOnly | RtsOptsAll
+
-- | Used by 'GHC.newSession' to partially initialize a new 'DynFlags' value
initDynFlags :: DynFlags -> IO DynFlags
initDynFlags dflags = do
cmdlineFrameworks = [],
tmpDir = cDEFAULT_TMPDIR,
rtsOpts = Nothing,
+ rtsOptsEnabled = RtsOptsSafeOnly,
hpcDir = ".hpc",
log_action = \severity srcSpan style msg ->
case severity of
- SevInfo -> printErrs (msg style)
- SevFatal -> printErrs (msg style)
- _ -> do
+ SevOutput -> printOutput (msg style)
+ SevInfo -> printErrs (msg style)
+ SevFatal -> printErrs (msg style)
+ _ -> do
hPutChar stderr '\n'
printErrs ((mkLocMessage srcSpan msg) style)
-- careful (#2302): printErrs prints in UTF-8, whereas
Opt_EmptyDataDecls,
Opt_ForeignFunctionInterface,
Opt_PatternGuards,
+ Opt_DoAndIfThenElse,
Opt_RelaxedPolyRec]
-- The DOpt class is a temporary workaround, to avoid having to do
, Flag "no-auto-link-packages" (NoArg (unSetDynFlag Opt_AutoLinkPackages)) Supported
, Flag "no-hs-main" (NoArg (setDynFlag Opt_NoHsMain)) Supported
, Flag "with-rtsopts" (HasArg setRtsOpts) Supported
- , Flag "rtsopts" (NoArg (setDynFlag Opt_RtsOptsEnabled)) Supported
- , Flag "no-rtsopts" (NoArg (unSetDynFlag Opt_RtsOptsEnabled)) Supported
+ , Flag "rtsopts" (NoArg (setRtsOptsEnabled RtsOptsAll)) Supported
+ , Flag "rtsopts=all" (NoArg (setRtsOptsEnabled RtsOptsAll)) Supported
+ , Flag "rtsopts=some" (NoArg (setRtsOptsEnabled RtsOptsSafeOnly)) Supported
+ , Flag "rtsopts=none" (NoArg (setRtsOptsEnabled RtsOptsNone)) Supported
+ , Flag "no-rtsopts" (NoArg (setRtsOptsEnabled RtsOptsNone)) Supported
, Flag "main-is" (SepArg setMainIs ) Supported
, Flag "haddock" (NoArg (setDynFlag Opt_Haddock)) Supported
, Flag "haddock-opts" (HasArg (upd . addHaddockOpts)) Supported
( "TemplateHaskell", Opt_TemplateHaskell, const Supported ),
( "QuasiQuotes", Opt_QuasiQuotes, const Supported ),
( "Generics", Opt_Generics, const Supported ),
- -- On by default:
( "ImplicitPrelude", Opt_ImplicitPrelude, const Supported ),
( "RecordWildCards", Opt_RecordWildCards, const Supported ),
( "NamedFieldPuns", Opt_RecordPuns, const Supported ),
( "ViewPatterns", Opt_ViewPatterns, const Supported ),
( "TypeFamilies", Opt_TypeFamilies, const Supported ),
( "BangPatterns", Opt_BangPatterns, const Supported ),
- -- On by default:
( "MonomorphismRestriction", Opt_MonomorphismRestriction, const Supported ),
- -- On by default:
( "NPlusKPatterns", Opt_NPlusKPatterns, const Supported ),
- -- On by default (which is not strictly H98):
+ ( "DoAndIfThenElse", Opt_DoAndIfThenElse, const Supported ),
( "MonoPatBinds", Opt_MonoPatBinds, const Supported ),
( "ExplicitForAll", Opt_ExplicitForAll, const Supported ),
( "AlternativeLayoutRule", Opt_AlternativeLayoutRule, const Supported ),
( "AlternativeLayoutRuleTransitional",Opt_AlternativeLayoutRuleTransitional, const Supported ),
- -- On by default:
( "DatatypeContexts", Opt_DatatypeContexts, const Supported ),
( "MonoLocalBinds", Opt_MonoLocalBinds, const Supported ),
( "RelaxedPolyRec", Opt_RelaxedPolyRec, const Supported ),
setRtsOpts :: String -> DynP ()
setRtsOpts arg = upd $ \ d -> d {rtsOpts = Just arg}
+setRtsOptsEnabled :: RtsOptsEnabled -> DynP ()
+setRtsOptsEnabled arg = upd $ \ d -> d {rtsOptsEnabled = arg}
+
-----------------------------------------------------------------------------
-- Hpc stuff