X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=2971aa11cacc231e3fee5544b0b0e9d833c9d550;hb=320738062c7a81f062c5adab98a1a1c4fdbd4bc7;hp=8b35821863b8fdb4c2c70068bd54cc6c4d0c41be;hpb=0e6ff027979263c36703f26da836a784fe1606a2;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 8b35821..2971aa1 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -19,6 +19,7 @@ module DynFlags ( lopt_set_flattened, lopt_unset_flattened, DynFlags(..), + RtsOptsEnabled(..), HscTarget(..), isObjectTarget, defaultObjectTarget, GhcMode(..), isOneShot, GhcLink(..), isNoLink, @@ -234,7 +235,6 @@ data DynFlag | Opt_EagerBlackHoling | Opt_ReadUserPackageConf | Opt_NoHsMain - | Opt_RtsOptsEnabled | Opt_SplitObjs | Opt_StgStats | Opt_HideAllPackages @@ -418,6 +418,7 @@ data DynFlags = DynFlags { ghcUsagePath :: FilePath, -- Filled in by SysTools ghciUsagePath :: FilePath, -- ditto rtsOpts :: Maybe String, + rtsOptsEnabled :: RtsOptsEnabled, hpcDir :: String, -- ^ Path to store the .mix files @@ -592,6 +593,8 @@ data DynLibLoader | 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 @@ -662,6 +665,7 @@ defaultDynFlags = cmdlineFrameworks = [], tmpDir = cDEFAULT_TMPDIR, rtsOpts = Nothing, + rtsOptsEnabled = RtsOptsSafeOnly, hpcDir = ".hpc", @@ -1247,8 +1251,11 @@ dynamic_flags = [ , 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 @@ -1752,7 +1759,6 @@ xFlags = [ ( "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 ), @@ -1764,16 +1770,12 @@ xFlags = [ ( "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): ( "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 ), @@ -2203,6 +2205,9 @@ setTmpDir dir dflags = dflags{ tmpDir = normalise dir } setRtsOpts :: String -> DynP () setRtsOpts arg = upd $ \ d -> d {rtsOpts = Just arg} +setRtsOptsEnabled :: RtsOptsEnabled -> DynP () +setRtsOptsEnabled arg = upd $ \ d -> d {rtsOptsEnabled = arg} + ----------------------------------------------------------------------------- -- Hpc stuff