Commit 46af6835 authored by nkartashov's avatar nkartashov Committed by Ben Gamari

compiler: Do not suggest nor complete deprecated flags fix trac issue #11454

Previously, all flags were present in user suggest and completion. This commit
removes the deprecated ones from there. It is done by saving deprecation info
at the moment of flag definition.

Reviewers: rwbarton, austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D1883
parent 51a33924
......@@ -104,7 +104,7 @@ module DynFlags (
parseDynamicFlagsFull,
-- ** Available DynFlags
allFlags,
allNonDeprecatedFlags,
flagsAll,
flagsDynamic,
flagsPackage,
......@@ -1932,25 +1932,25 @@ setObjectDir, setHiDir, setStubDir, setDumpDir, setOutputDir,
setOutputFile, setDynOutputFile, setOutputHi, setDumpPrefixForce
:: Maybe String -> DynFlags -> DynFlags
setObjectDir f d = d{ objectDir = Just f}
setHiDir f d = d{ hiDir = Just f}
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
setObjectDir f d = d { objectDir = Just f}
setHiDir f d = d { hiDir = Just f}
setStubDir f d = d { stubDir = Just f, includePaths = f : includePaths d }
-- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file
-- \#included from the .hc file when compiling via C (i.e. unregisterised
-- builds).
setDumpDir f d = d{ dumpDir = Just f}
setDumpDir f d = d { dumpDir = Just f}
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f
setDylibInstallName f d = d{ dylibInstallName = Just f}
setDylibInstallName f d = d { dylibInstallName = Just f}
setObjectSuf f d = d{ objectSuf = f}
setDynObjectSuf f d = d{ dynObjectSuf = f}
setHiSuf f d = d{ hiSuf = f}
setDynHiSuf f d = d{ dynHiSuf = f}
setHcSuf f d = d{ hcSuf = f}
setObjectSuf f d = d { objectSuf = f}
setDynObjectSuf f d = d { dynObjectSuf = f}
setHiSuf f d = d { hiSuf = f}
setDynHiSuf f d = d { dynHiSuf = f}
setHcSuf f d = d { hcSuf = f}
setOutputFile f d = d{ outputFile = f}
setDynOutputFile f d = d{ dynOutputFile = f}
setOutputHi f d = d{ outputHi = f}
setOutputFile f d = d { outputFile = f}
setDynOutputFile f d = d { dynOutputFile = f}
setOutputHi f d = d { outputHi = f}
parseSigOf :: String -> SigOf
parseSigOf str = case filter ((=="").snd) (readP_to_S parse str) of
......@@ -1988,8 +1988,8 @@ addFrontendPluginOption s d = d { frontendPluginOpts = s : frontendPluginOpts d
parseDynLibLoaderMode f d =
case splitAt 8 f of
("deploy", "") -> d{ dynLibLoader = Deployable }
("sysdep", "") -> d{ dynLibLoader = SystemDependent }
("deploy", "") -> d { dynLibLoader = Deployable }
("sysdep", "") -> d { dynLibLoader = SystemDependent }
_ -> throwGhcException (CmdLineError ("Unknown dynlib loader: " ++ f))
setDumpPrefixForce f d = d { dumpPrefixForce = f}
......@@ -2015,13 +2015,13 @@ addDepExcludeMod m d
addDepSuffix :: FilePath -> DynFlags -> DynFlags
addDepSuffix s d = d { depSuffixes = s : depSuffixes d }
addCmdlineFramework f d = d{ cmdlineFrameworks = f : cmdlineFrameworks d}
addCmdlineFramework f d = d { cmdlineFrameworks = f : cmdlineFrameworks d}
addHaddockOpts f d = d{ haddockOptions = Just f}
addHaddockOpts f d = d { haddockOptions = Just f}
addGhciScript f d = d{ ghciScripts = f : ghciScripts d}
addGhciScript f d = d { ghciScripts = f : ghciScripts d}
setInteractivePrint f d = d{ interactivePrint = Just f}
setInteractivePrint f d = d { interactivePrint = Just f}
-- -----------------------------------------------------------------------------
-- Command-line options
......@@ -2209,14 +2209,21 @@ safeFlagCheck cmdl dflags =
%* *
%********************************************************************* -}
-- | All dynamic flags option strings. These are the user facing strings for
-- enabling and disabling options.
allFlags :: [String]
allFlags = [ '-':flagName flag
| flag <- flagsAll
, ok (flagOptKind flag) ]
-- | All dynamic flags option strings without the deprecated ones.
-- These are the user facing strings for enabling and disabling options.
allNonDeprecatedFlags :: [String]
allNonDeprecatedFlags = allFlagsDeps False
-- | All flags with possibility to filter deprecated ones
allFlagsDeps :: Bool -> [String]
allFlagsDeps keepDeprecated = [ '-':flagName flag
| (deprecated, flag) <- flagsAllDeps
, ok (flagOptKind flag)
, keepDeprecated || not (isDeprecated deprecated)]
where ok (PrefixPred _ _) = False
ok _ = True
isDeprecated Deprecated = True
isDeprecated _ = False
{-
- Below we export user facing symbols for GHC dynamic flags for use with the
......@@ -2225,58 +2232,105 @@ allFlags = [ '-':flagName flag
-- All dynamic flags present in GHC.
flagsAll :: [Flag (CmdLineP DynFlags)]
flagsAll = package_flags ++ dynamic_flags
flagsAll = map snd flagsAllDeps
-- All dynamic flags present in GHC with deprecation information.
flagsAllDeps :: [(Deprecation, Flag (CmdLineP DynFlags))]
flagsAllDeps = package_flags_deps ++ dynamic_flags_deps
-- All dynamic flags, minus package flags, present in GHC.
flagsDynamic :: [Flag (CmdLineP DynFlags)]
flagsDynamic = dynamic_flags
flagsDynamic = map snd dynamic_flags_deps
-- ALl package flags present in GHC.
flagsPackage :: [Flag (CmdLineP DynFlags)]
flagsPackage = package_flags
flagsPackage = map snd package_flags_deps
----------------Helpers to make flags and keep deprecation information----------
type FlagMaker m = String -> OptKind m -> Flag m
type DynFlagMaker = FlagMaker (CmdLineP DynFlags)
data Deprecation = Deprecated | NotDeprecated
-- Make a non-deprecated flag
make_ord_flag :: DynFlagMaker -> String -> OptKind (CmdLineP DynFlags)
-> (Deprecation, Flag (CmdLineP DynFlags))
make_ord_flag fm name kind = (NotDeprecated, fm name kind)
-- Make a deprecated flag
make_dep_flag :: DynFlagMaker -> String -> OptKind (CmdLineP DynFlags) -> String
-> (Deprecation, Flag (CmdLineP DynFlags))
make_dep_flag fm name kind message = (Deprecated,
fm name $ add_dep_message kind message)
--------------- The main flags themselves ------------------
add_dep_message :: OptKind (CmdLineP DynFlags) -> String
-> OptKind (CmdLineP DynFlags)
add_dep_message (NoArg f) message = NoArg $ f >> deprecate message
add_dep_message (HasArg f) message = HasArg $ \s -> f s >> deprecate message
add_dep_message (SepArg f) message = SepArg $ \s -> f s >> deprecate message
add_dep_message (Prefix f) message = Prefix $ \s -> f s >> deprecate message
add_dep_message (OptPrefix f) message =
OptPrefix $ \s -> f s >> deprecate message
add_dep_message (OptIntSuffix f) message =
OptIntSuffix $ \oi -> f oi >> deprecate message
add_dep_message (IntSuffix f) message =
IntSuffix $ \i -> f i >> deprecate message
add_dep_message (FloatSuffix f) message =
FloatSuffix $ \fl -> f fl >> deprecate message
add_dep_message (PassFlag f) message =
PassFlag $ \s -> f s >> deprecate message
add_dep_message (AnySuffix f) message =
AnySuffix $ \s -> f s >> deprecate message
add_dep_message (PrefixPred pred f) message =
PrefixPred pred $ \s -> f s >> deprecate message
add_dep_message (AnySuffixPred pred f) message =
AnySuffixPred pred $ \s -> f s >> deprecate message
----------------------- The main flags themselves ------------------------------
-- See Note [Updating flag description in the User's Guide]
-- See Note [Supporting CLI completion]
dynamic_flags :: [Flag (CmdLineP DynFlags)]
dynamic_flags = [
defFlag "n"
(NoArg (addWarn "The -n flag is deprecated and no longer has any effect"))
, defFlag "cpp" (NoArg (setExtensionFlag LangExt.Cpp))
, defFlag "F" (NoArg (setGeneralFlag Opt_Pp))
, defFlag "#include"
(HasArg (\_s -> do
dynamic_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]
dynamic_flags_deps = [
make_dep_flag defFlag "n" (NoArg $ return ())
"The -n flag is deprecated and no longer has any effect"
, make_ord_flag defFlag "cpp" (NoArg (setExtensionFlag LangExt.Cpp))
, make_ord_flag defFlag "F" (NoArg (setGeneralFlag Opt_Pp))
, (Deprecated, defFlag "#include"
(HasArg (\_s ->
addWarn ("-#include and INCLUDE pragmas are " ++
"deprecated: They no longer have any effect")))
, defFlag "v" (OptIntSuffix setVerbosity)
"deprecated: They no longer have any effect"))))
, make_ord_flag defFlag "v" (OptIntSuffix setVerbosity)
, defGhcFlag "j" (OptIntSuffix (\n -> upd (\d -> d {parMakeCount = n})))
, defFlag "sig-of" (sepArg setSigOf)
, make_ord_flag defGhcFlag "j" (OptIntSuffix (\n ->
upd (\d -> d {parMakeCount = n})))
, make_ord_flag defFlag "sig-of" (sepArg setSigOf)
-- RTS options -------------------------------------------------------------
, defFlag "H" (HasArg (\s -> upd (\d ->
, make_ord_flag defFlag "H" (HasArg (\s -> upd (\d ->
d { ghcHeapSize = Just $ fromIntegral (decodeSize s)})))
, defFlag "Rghc-timing" (NoArg (upd (\d -> d { enableTimeStats = True })))
, make_ord_flag defFlag "Rghc-timing" (NoArg (upd (\d ->
d { enableTimeStats = True })))
------- ways ---------------------------------------------------------------
, defGhcFlag "prof" (NoArg (addWay WayProf))
, defGhcFlag "eventlog" (NoArg (addWay WayEventLog))
, defGhcFlag "smp"
(NoArg (addWay WayThreaded >> deprecate "Use -threaded instead"))
, defGhcFlag "debug" (NoArg (addWay WayDebug))
, defGhcFlag "threaded" (NoArg (addWay WayThreaded))
, defGhcFlag "ticky"
, make_ord_flag defGhcFlag "prof" (NoArg (addWay WayProf))
, make_ord_flag defGhcFlag "eventlog" (NoArg (addWay WayEventLog))
, make_dep_flag defGhcFlag "smp"
(NoArg $ addWay WayThreaded) "Use -threaded instead"
, make_ord_flag defGhcFlag "debug" (NoArg (addWay WayDebug))
, make_ord_flag defGhcFlag "threaded" (NoArg (addWay WayThreaded))
, make_ord_flag defGhcFlag "ticky"
(NoArg (setGeneralFlag Opt_Ticky >> addWay WayDebug))
-- -ticky enables ticky-ticky code generation, and also implies -debug which
-- is required to get the RTS ticky support.
----- Linker --------------------------------------------------------
, defGhcFlag "static" (NoArg removeWayDyn)
, defGhcFlag "dynamic" (NoArg (addWay WayDyn))
, defGhcFlag "rdynamic" $ noArg $
, make_ord_flag defGhcFlag "static" (NoArg removeWayDyn)
, make_ord_flag defGhcFlag "dynamic" (NoArg (addWay WayDyn))
, make_ord_flag defGhcFlag "rdynamic" $ noArg $
#ifdef linux_HOST_OS
addOptl "-rdynamic"
#elif defined (mingw32_HOST_OS)
......@@ -2285,67 +2339,67 @@ dynamic_flags = [
-- ignored for compat w/ gcc:
id
#endif
, defGhcFlag "relative-dynlib-paths"
, make_ord_flag defGhcFlag "relative-dynlib-paths"
(NoArg (setGeneralFlag Opt_RelativeDynlibPaths))
------- Specific phases --------------------------------------------
-- need to appear before -pgmL to be parsed as LLVM flags.
, defFlag "pgmlo"
, make_ord_flag defFlag "pgmlo"
(hasArg (\f -> alterSettings (\s -> s { sPgm_lo = (f,[])})))
, defFlag "pgmlc"
, make_ord_flag defFlag "pgmlc"
(hasArg (\f -> alterSettings (\s -> s { sPgm_lc = (f,[])})))
, defFlag "pgmi"
, make_ord_flag defFlag "pgmi"
(hasArg (\f -> alterSettings (\s -> s { sPgm_i = f})))
, defFlag "pgmL"
, make_ord_flag defFlag "pgmL"
(hasArg (\f -> alterSettings (\s -> s { sPgm_L = f})))
, defFlag "pgmP"
, make_ord_flag defFlag "pgmP"
(hasArg setPgmP)
, defFlag "pgmF"
, make_ord_flag defFlag "pgmF"
(hasArg (\f -> alterSettings (\s -> s { sPgm_F = f})))
, defFlag "pgmc"
, make_ord_flag defFlag "pgmc"
(hasArg (\f -> alterSettings (\s -> s { sPgm_c = (f,[])})))
, defFlag "pgms"
, make_ord_flag defFlag "pgms"
(hasArg (\f -> alterSettings (\s -> s { sPgm_s = (f,[])})))
, defFlag "pgma"
, make_ord_flag defFlag "pgma"
(hasArg (\f -> alterSettings (\s -> s { sPgm_a = (f,[])})))
, defFlag "pgml"
, make_ord_flag defFlag "pgml"
(hasArg (\f -> alterSettings (\s -> s { sPgm_l = (f,[])})))
, defFlag "pgmdll"
, make_ord_flag defFlag "pgmdll"
(hasArg (\f -> alterSettings (\s -> s { sPgm_dll = (f,[])})))
, defFlag "pgmwindres"
, make_ord_flag defFlag "pgmwindres"
(hasArg (\f -> alterSettings (\s -> s { sPgm_windres = f})))
, defFlag "pgmlibtool"
, make_ord_flag defFlag "pgmlibtool"
(hasArg (\f -> alterSettings (\s -> s { sPgm_libtool = f})))
-- need to appear before -optl/-opta to be parsed as LLVM flags.
, defFlag "optlo"
, make_ord_flag defFlag "optlo"
(hasArg (\f -> alterSettings (\s -> s { sOpt_lo = f : sOpt_lo s})))
, defFlag "optlc"
, make_ord_flag defFlag "optlc"
(hasArg (\f -> alterSettings (\s -> s { sOpt_lc = f : sOpt_lc s})))
, defFlag "opti"
, make_ord_flag defFlag "opti"
(hasArg (\f -> alterSettings (\s -> s { sOpt_i = f : sOpt_i s})))
, defFlag "optL"
, make_ord_flag defFlag "optL"
(hasArg (\f -> alterSettings (\s -> s { sOpt_L = f : sOpt_L s})))
, defFlag "optP"
, make_ord_flag defFlag "optP"
(hasArg addOptP)
, defFlag "optF"
, make_ord_flag defFlag "optF"
(hasArg (\f -> alterSettings (\s -> s { sOpt_F = f : sOpt_F s})))
, defFlag "optc"
, make_ord_flag defFlag "optc"
(hasArg addOptc)
, defFlag "opta"
, make_ord_flag defFlag "opta"
(hasArg (\f -> alterSettings (\s -> s { sOpt_a = f : sOpt_a s})))
, defFlag "optl"
, make_ord_flag defFlag "optl"
(hasArg addOptl)
, defFlag "optwindres"
, make_ord_flag defFlag "optwindres"
(hasArg (\f ->
alterSettings (\s -> s { sOpt_windres = f : sOpt_windres s})))
, defGhcFlag "split-objs"
, make_ord_flag defGhcFlag "split-objs"
(NoArg (if can_split
then setGeneralFlag Opt_SplitObjs
else addWarn "ignoring -fsplit-objs"))
, defGhcFlag "split-sections"
, make_ord_flag defGhcFlag "split-sections"
(noArgM (\dflags -> do
if platformHasSubsectionsViaSymbols (targetPlatform dflags)
then do addErr $
......@@ -2355,110 +2409,137 @@ dynamic_flags = [
else return (gopt_set dflags Opt_SplitSections)))
-------- ghc -M -----------------------------------------------------
, defGhcFlag "dep-suffix" (hasArg addDepSuffix)
, defGhcFlag "dep-makefile" (hasArg setDepMakefile)
, defGhcFlag "include-pkg-deps" (noArg (setDepIncludePkgDeps True))
, defGhcFlag "exclude-module" (hasArg addDepExcludeMod)
, make_ord_flag defGhcFlag "dep-suffix" (hasArg addDepSuffix)
, make_ord_flag defGhcFlag "dep-makefile" (hasArg setDepMakefile)
, make_ord_flag defGhcFlag "include-pkg-deps"
(noArg (setDepIncludePkgDeps True))
, make_ord_flag defGhcFlag "exclude-module" (hasArg addDepExcludeMod)
-------- Linking ----------------------------------------------------
, defGhcFlag "no-link" (noArg (\d -> d{ ghcLink=NoLink }))
, defGhcFlag "shared" (noArg (\d -> d{ ghcLink=LinkDynLib }))
, defGhcFlag "staticlib" (noArg (\d -> d{ ghcLink=LinkStaticLib }))
, defGhcFlag "dynload" (hasArg parseDynLibLoaderMode)
, defGhcFlag "dylib-install-name" (hasArg setDylibInstallName)
, make_ord_flag defGhcFlag "no-link"
(noArg (\d -> d { ghcLink=NoLink }))
, make_ord_flag defGhcFlag "shared"
(noArg (\d -> d { ghcLink=LinkDynLib }))
, make_ord_flag defGhcFlag "staticlib"
(noArg (\d -> d { ghcLink=LinkStaticLib }))
, make_ord_flag defGhcFlag "dynload" (hasArg parseDynLibLoaderMode)
, make_ord_flag defGhcFlag "dylib-install-name" (hasArg setDylibInstallName)
-- -dll-split is an internal flag, used only during the GHC build
, defHiddenFlag "dll-split"
(hasArg (\f d -> d{ dllSplitFile = Just f, dllSplit = Nothing }))
, make_ord_flag defHiddenFlag "dll-split"
(hasArg (\f d -> d { dllSplitFile = Just f, dllSplit = Nothing }))
------- Libraries ---------------------------------------------------
, defFlag "L" (Prefix addLibraryPath)
, defFlag "l" (hasArg (addLdInputs . Option . ("-l" ++)))
, make_ord_flag defFlag "L" (Prefix addLibraryPath)
, make_ord_flag defFlag "l" (hasArg (addLdInputs . Option . ("-l" ++)))
------- Frameworks --------------------------------------------------
-- -framework-path should really be -F ...
, defFlag "framework-path" (HasArg addFrameworkPath)
, defFlag "framework" (hasArg addCmdlineFramework)
, make_ord_flag defFlag "framework-path" (HasArg addFrameworkPath)
, make_ord_flag defFlag "framework" (hasArg addCmdlineFramework)
------- Output Redirection ------------------------------------------
, defGhcFlag "odir" (hasArg setObjectDir)
, defGhcFlag "o" (sepArg (setOutputFile . Just))
, defGhcFlag "dyno" (sepArg (setDynOutputFile . Just))
, defGhcFlag "ohi" (hasArg (setOutputHi . Just ))
, defGhcFlag "osuf" (hasArg setObjectSuf)
, defGhcFlag "dynosuf" (hasArg setDynObjectSuf)
, defGhcFlag "hcsuf" (hasArg setHcSuf)
, defGhcFlag "hisuf" (hasArg setHiSuf)
, defGhcFlag "dynhisuf" (hasArg setDynHiSuf)
, defGhcFlag "hidir" (hasArg setHiDir)
, defGhcFlag "tmpdir" (hasArg setTmpDir)
, defGhcFlag "stubdir" (hasArg setStubDir)
, defGhcFlag "dumpdir" (hasArg setDumpDir)
, defGhcFlag "outputdir" (hasArg setOutputDir)
, defGhcFlag "ddump-file-prefix" (hasArg (setDumpPrefixForce . Just))
, defGhcFlag "dynamic-too" (NoArg (setGeneralFlag Opt_BuildDynamicToo))
, make_ord_flag defGhcFlag "odir" (hasArg setObjectDir)
, make_ord_flag defGhcFlag "o" (sepArg (setOutputFile . Just))
, make_ord_flag defGhcFlag "dyno"
(sepArg (setDynOutputFile . Just))
, make_ord_flag defGhcFlag "ohi"
(hasArg (setOutputHi . Just ))
, make_ord_flag defGhcFlag "osuf" (hasArg setObjectSuf)
, make_ord_flag defGhcFlag "dynosuf" (hasArg setDynObjectSuf)
, make_ord_flag defGhcFlag "hcsuf" (hasArg setHcSuf)
, make_ord_flag defGhcFlag "hisuf" (hasArg setHiSuf)
, make_ord_flag defGhcFlag "dynhisuf" (hasArg setDynHiSuf)
, make_ord_flag defGhcFlag "hidir" (hasArg setHiDir)
, make_ord_flag defGhcFlag "tmpdir" (hasArg setTmpDir)
, make_ord_flag defGhcFlag "stubdir" (hasArg setStubDir)
, make_ord_flag defGhcFlag "dumpdir" (hasArg setDumpDir)
, make_ord_flag defGhcFlag "outputdir" (hasArg setOutputDir)
, make_ord_flag defGhcFlag "ddump-file-prefix"
(hasArg (setDumpPrefixForce . Just))
, make_ord_flag defGhcFlag "dynamic-too"
(NoArg (setGeneralFlag Opt_BuildDynamicToo))
------- Keeping temporary files -------------------------------------
-- These can be singular (think ghc -c) or plural (think ghc --make)
, defGhcFlag "keep-hc-file" (NoArg (setGeneralFlag Opt_KeepHcFiles))
, defGhcFlag "keep-hc-files" (NoArg (setGeneralFlag Opt_KeepHcFiles))
, defGhcFlag "keep-s-file" (NoArg (setGeneralFlag Opt_KeepSFiles))
, defGhcFlag "keep-s-files" (NoArg (setGeneralFlag Opt_KeepSFiles))
, defGhcFlag "keep-llvm-file" (NoArg (do setObjTarget HscLlvm
setGeneralFlag Opt_KeepLlvmFiles))
, defGhcFlag "keep-llvm-files" (NoArg (do setObjTarget HscLlvm
setGeneralFlag Opt_KeepLlvmFiles))
, make_ord_flag defGhcFlag "keep-hc-file"
(NoArg (setGeneralFlag Opt_KeepHcFiles))
, make_ord_flag defGhcFlag "keep-hc-files"
(NoArg (setGeneralFlag Opt_KeepHcFiles))
, make_ord_flag defGhcFlag "keep-s-file"
(NoArg (setGeneralFlag Opt_KeepSFiles))
, make_ord_flag defGhcFlag "keep-s-files"
(NoArg (setGeneralFlag Opt_KeepSFiles))
, make_ord_flag defGhcFlag "keep-llvm-file"
(NoArg $ setObjTarget HscLlvm >> setGeneralFlag Opt_KeepLlvmFiles)
, make_ord_flag defGhcFlag "keep-llvm-files"
(NoArg $ setObjTarget HscLlvm >> setGeneralFlag Opt_KeepLlvmFiles)
-- This only makes sense as plural
, defGhcFlag "keep-tmp-files" (NoArg (setGeneralFlag Opt_KeepTmpFiles))
, make_ord_flag defGhcFlag "keep-tmp-files"
(NoArg (setGeneralFlag Opt_KeepTmpFiles))
------- Miscellaneous ----------------------------------------------
, defGhcFlag "no-auto-link-packages"
, make_ord_flag defGhcFlag "no-auto-link-packages"
(NoArg (unSetGeneralFlag Opt_AutoLinkPackages))
, defGhcFlag "no-hs-main" (NoArg (setGeneralFlag Opt_NoHsMain))
, defGhcFlag "with-rtsopts" (HasArg setRtsOpts)
, defGhcFlag "rtsopts" (NoArg (setRtsOptsEnabled RtsOptsAll))
, defGhcFlag "rtsopts=all" (NoArg (setRtsOptsEnabled RtsOptsAll))
, defGhcFlag "rtsopts=some" (NoArg (setRtsOptsEnabled RtsOptsSafeOnly))
, defGhcFlag "rtsopts=none" (NoArg (setRtsOptsEnabled RtsOptsNone))
, defGhcFlag "no-rtsopts" (NoArg (setRtsOptsEnabled RtsOptsNone))
, defGhcFlag "no-rtsopts-suggestions"
(noArg (\d -> d {rtsOptsSuggestions = False} ))
, defGhcFlag "main-is" (SepArg setMainIs)
, defGhcFlag "haddock" (NoArg (setGeneralFlag Opt_Haddock))
, defGhcFlag "haddock-opts" (hasArg addHaddockOpts)
, defGhcFlag "hpcdir" (SepArg setOptHpcDir)
, defGhciFlag "ghci-script" (hasArg addGhciScript)
, defGhciFlag "interactive-print" (hasArg setInteractivePrint)
, defGhcFlag "ticky-allocd" (NoArg (setGeneralFlag Opt_Ticky_Allocd))
, defGhcFlag "ticky-LNE" (NoArg (setGeneralFlag Opt_Ticky_LNE))
, defGhcFlag "ticky-dyn-thunk" (NoArg (setGeneralFlag Opt_Ticky_Dyn_Thunk))
, make_ord_flag defGhcFlag "no-hs-main"
(NoArg (setGeneralFlag Opt_NoHsMain))
, make_ord_flag defGhcFlag "with-rtsopts"
(HasArg setRtsOpts)
, make_ord_flag defGhcFlag "rtsopts"
(NoArg (setRtsOptsEnabled RtsOptsAll))
, make_ord_flag defGhcFlag "rtsopts=all"
(NoArg (setRtsOptsEnabled RtsOptsAll))
, make_ord_flag defGhcFlag "rtsopts=some"
(NoArg (setRtsOptsEnabled RtsOptsSafeOnly))
, make_ord_flag defGhcFlag "rtsopts=none"
(NoArg (setRtsOptsEnabled RtsOptsNone))
, make_ord_flag defGhcFlag "no-rtsopts"
(NoArg (setRtsOptsEnabled RtsOptsNone))
, make_ord_flag defGhcFlag "no-rtsopts-suggestions"
(noArg (\d -> d {rtsOptsSuggestions = False}))
, make_ord_flag defGhcFlag "main-is" (SepArg setMainIs)
, make_ord_flag defGhcFlag "haddock" (NoArg (setGeneralFlag Opt_Haddock))
, make_ord_flag defGhcFlag "haddock-opts" (hasArg addHaddockOpts)
, make_ord_flag defGhcFlag "hpcdir" (SepArg setOptHpcDir)
, make_ord_flag defGhciFlag "ghci-script" (hasArg addGhciScript)
, make_ord_flag defGhciFlag "interactive-print" (hasArg setInteractivePrint)
, make_ord_flag defGhcFlag "ticky-allocd"
(NoArg (setGeneralFlag Opt_Ticky_Allocd))
, make_ord_flag defGhcFlag "ticky-LNE"
(NoArg (setGeneralFlag Opt_Ticky_LNE))
, make_ord_flag defGhcFlag "ticky-dyn-thunk"
(NoArg (setGeneralFlag Opt_Ticky_Dyn_Thunk))
------- recompilation checker --------------------------------------
, defGhcFlag "recomp" (NoArg (do unSetGeneralFlag Opt_ForceRecomp
deprecate "Use -fno-force-recomp instead"))
, defGhcFlag "no-recomp" (NoArg (do setGeneralFlag Opt_ForceRecomp
deprecate "Use -fforce-recomp instead"))
, defFlag "freverse-errors"
, make_dep_flag defGhcFlag "recomp"
(NoArg $ unSetGeneralFlag Opt_ForceRecomp)
"Use -fno-force-recomp instead"
, make_dep_flag defGhcFlag "no-recomp"
(NoArg $ setGeneralFlag Opt_ForceRecomp) "Use -fforce-recomp instead"
, make_ord_flag defFlag "freverse-errors"
(noArg (\d -> d {reverseErrors = True} ))
, defFlag "fno-reverse-errors"
, make_ord_flag defFlag "fno-reverse-errors"
(noArg (\d -> d {reverseErrors = False} ))
------ HsCpp opts ---------------------------------------------------
, defFlag "D" (AnySuffix (upd . addOptP))
, defFlag "U" (AnySuffix (upd . addOptP))
, make_ord_flag defFlag "D" (AnySuffix (upd . addOptP))
, make_ord_flag defFlag "U" (AnySuffix (upd . addOptP))
------- Include/Import Paths ----------------------------------------
, defFlag "I" (Prefix addIncludePath)
, defFlag "i" (OptPrefix addImportPath)
, make_ord_flag defFlag "I" (Prefix addIncludePath)
, make_ord_flag defFlag "i" (OptPrefix addImportPath)
------ Output style options -----------------------------------------
, defFlag "dppr-user-length" (intSuffix (\n d -> d{ pprUserLength = n }))
, defFlag "dppr-cols" (intSuffix (\n d -> d{ pprCols = n }))
, defGhcFlag "dtrace-level" (intSuffix (\n d -> d{ traceLevel = n }))
, make_ord_flag defFlag "dppr-user-length" (intSuffix (\n d ->
d { pprUserLength = n }))
, make_ord_flag defFlag "dppr-cols" (intSuffix (\n d ->
d { pprCols = n }))
, make_ord_flag defGhcFlag "dtrace-level" (intSuffix (\n d ->
d { traceLevel = n }))
-- Suppress all that is suppressable in core dumps.
-- Except for uniques, as some simplifier phases introduce new variables that
-- have otherwise identical names.
, defGhcFlag "dsuppress-all"
, make_ord_flag defGhcFlag "dsuppress-all"
(NoArg $ do setGeneralFlag Opt_SuppressCoercions
setGeneralFlag Opt_SuppressVarKinds
setGeneralFlag Opt_SuppressModulePrefixes
......@@ -2467,320 +2548,408 @@ dynamic_flags = [
setGeneralFlag Opt_SuppressTypeSignatures)
------ Debugging ----------------------------------------------------
, defGhcFlag "dstg-stats" (NoArg (setGeneralFlag Opt_StgStats))
, defGhcFlag "ddump-cmm" (setDumpFlag Opt_D_dump_cmm)
, defGhcFlag "ddump-cmm-raw" (setDumpFlag Opt_D_dump_cmm_raw)
, defGhcFlag "ddump-cmm-cfg" (setDumpFlag Opt_D_dump_cmm_cfg)
, defGhcFlag "ddump-cmm-cbe" (setDumpFlag Opt_D_dump_cmm_cbe)
, defGhcFlag "ddump-cmm-switch" (setDumpFlag Opt_D_dump_cmm_switch)
, defGhcFlag "ddump-cmm-proc" (setDumpFlag Opt_D_dump_cmm_proc)
, defGhcFlag "ddump-cmm-sink" (setDumpFlag Opt_D_dump_cmm_sink)
, defGhcFlag "ddump-cmm-sp" (setDumpFlag Opt_D_dump_cmm_sp)
, defGhcFlag "ddump-cmm-procmap" (setDumpFlag Opt_D_dump_cmm_procmap)
, defGhcFlag "ddump-cmm-split" (setDumpFlag Opt_D_dump_cmm_split)
, defGhcFlag "ddump-cmm-info" (setDumpFlag Opt_D_dump_cmm_info)
, defGhcFlag "ddump-cmm-cps" (setDumpFlag Opt_D_dump_cmm_cps)
, defGhcFlag "ddump-core-stats" (setDumpFlag Opt_D_dump_core_stats)
, defGhcFlag "ddump-asm" (setDumpFlag Opt_D_dump_asm)
, defGhcFlag "ddump-asm-native" (setDumpFlag Opt_D_dump_asm_native)
, defGhcFlag "ddump-asm-liveness" (setDumpFlag Opt_D_dump_asm_liveness)
, defGhcFlag "ddump-asm-regalloc" (setDumpFlag Opt_D_dump_asm_regalloc)
, defGhcFlag "ddump-asm-conflicts" (setDumpFlag Opt_D_dump_asm_conflicts)
, defGhcFlag "ddump-asm-regalloc-stages"
, make_ord_flag defGhcFlag "dstg-stats"
(NoArg (setGeneralFlag Opt_StgStats))
, make_ord_flag defGhcFlag "ddump-cmm"
(setDumpFlag Opt_D_dump_cmm)
, make_ord_flag defGhcFlag "ddump-cmm-raw"
(setDumpFlag Opt_D_dump_cmm_raw)
, make_ord_flag defGhcFlag "ddump-cmm-cfg"
(setDumpFlag Opt_D_dump_cmm_cfg)
, make_ord_flag defGhcFlag "ddump-cmm-cbe"
(setDumpFlag Opt_D_dump_cmm_cbe)
, make_ord_flag defGhcFlag "ddump-cmm-switch"
(setDumpFlag Opt_D_dump_cmm_switch)
, make_ord_flag defGhcFlag "ddump-cmm-proc"
(setDumpFlag Opt_D_dump_cmm_proc)
, make_ord_flag defGhcFlag "ddump-cmm-sink"
(setDumpFlag Opt_D_dump_cmm_sink)
, make_ord_flag defGhcFlag "ddump-cmm-sp"
(setDumpFlag Opt_D_dump_cmm_sp)