X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlagParser.hs;h=f3d737cbd74ae773caffacb1bf69beb490200d3c;hb=703ca1542c8e0983cc9d8eebce6e9f3dd3fd71e2;hp=aaab558c69b20a8e2d1662a3e611fa74f8e4b146;hpb=fc9bbbab3fe56cf0ff5723abbdb0f496d257f34e;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlagParser.hs b/compiler/main/StaticFlagParser.hs index aaab558..f3d737c 100644 --- a/compiler/main/StaticFlagParser.hs +++ b/compiler/main/StaticFlagParser.hs @@ -28,6 +28,21 @@ import Data.List ----------------------------------------------------------------------------- -- Static flags +-- | Parses GHC's static flags from a list of command line arguments. +-- +-- These flags are static in the sense that they can be set only once and they +-- are global, meaning that they affect every instance of GHC running; +-- multiple GHC threads will use the same flags. +-- +-- This function must be called before any session is started, i.e., before +-- the first call to 'GHC.withGhc'. +-- +-- Static flags are more of a hack and are static for more or less historical +-- reasons. In the long run, most static flags should eventually become +-- dynamic flags. +-- +-- XXX: can we add an auto-generated list of static flags here? +-- parseStaticFlags :: [Located String] -> IO ([Located String], [Located String]) parseStaticFlags args = do ready <- readIORef v_opt_C_ready @@ -91,6 +106,7 @@ static_flags = [ ------- ways -------------------------------------------------------- , Flag "prof" (NoArg (addWay WayProf)) Supported + , Flag "eventlog" (NoArg (addWay WayEventLog)) Supported , Flag "ticky" (NoArg (addWay WayTicky)) Supported , Flag "parallel" (NoArg (addWay WayPar)) Supported , Flag "gransim" (NoArg (addWay WayGran)) Supported @@ -107,24 +123,9 @@ static_flags = [ , Flag "dppr-user-length" (AnySuffix addOpt) Supported , Flag "dopt-fuel" (AnySuffix addOpt) Supported , Flag "dno-debug-output" (PassFlag addOpt) Supported + , Flag "dstub-dead-values" (PassFlag addOpt) Supported -- rest of the debugging flags are dynamic - --------- Profiling -------------------------------------------------- - , Flag "auto-all" (NoArg (addOpt "-fauto-sccs-on-all-toplevs")) - Supported - , Flag "auto" (NoArg (addOpt "-fauto-sccs-on-exported-toplevs")) - Supported - , Flag "caf-all" (NoArg (addOpt "-fauto-sccs-on-individual-cafs")) - Supported - -- "ignore-sccs" doesn't work (ToDo) - - , Flag "no-auto-all" (NoArg (removeOpt "-fauto-sccs-on-all-toplevs")) - Supported - , Flag "no-auto" (NoArg (removeOpt "-fauto-sccs-on-exported-toplevs")) - Supported - , Flag "no-caf-all" (NoArg (removeOpt "-fauto-sccs-on-individual-cafs")) - Supported - ----- Linker -------------------------------------------------------- , Flag "static" (PassFlag addOpt) Supported , Flag "dynamic" (NoArg (removeOpt "-static")) Supported @@ -143,16 +144,12 @@ static_flags = [ Supported -- Pass all remaining "-f" options to hsc - , Flag "f" (AnySuffixPred (isStaticFlag) addOpt) - Supported + , Flag "f" (AnySuffixPred isStaticFlag addOpt) Supported ] isStaticFlag :: String -> Bool isStaticFlag f = f `elem` [ - "fauto-sccs-on-all-toplevs", - "fauto-sccs-on-exported-toplevs", - "fauto-sccs-on-individual-cafs", "fscc-profiling", "fdicts-strict", "fspec-inline-join-points", @@ -161,8 +158,8 @@ isStaticFlag f = "fgransim", "fno-hi-version-check", "dno-black-holing", - "fno-method-sharing", "fno-state-hack", + "fsimple-list-literals", "fno-ds-multi-tyvar", "fruntime-types", "fno-pre-inlining", @@ -170,7 +167,6 @@ isStaticFlag f = "static", "fhardwire-lib-paths", "funregisterised", - "fext-core", "fcpr-off", "ferror-spans", "fPIC",