X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=cf1d7e9bedb3e64b5ad4fa0953e51634d6575ff0;hb=a47d62f78621bb35f4ba73cd3817f33fda95fa72;hp=bb8555ef65b528247aecdd955717c885b4a1d194;hpb=3998d13f096efb302cf83865b611746765596754;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index bb8555e..cf1d7e9 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1,14 +1,12 @@ ------------------------------------------------------------------------------ --- +-- | -- Dynamic flags -- -- -- (c) The University of Glasgow 2005 -- ------------------------------------------------------------------------------ --- | Most flags are dynamic flags, which means they can change from +-- Most flags are dynamic flags, which means they can change from -- compilation to compilation using @OPTIONS_GHC@ pragmas, and in a -- multi-session GHC each session can be using different dynamic -- flags. Dynamic flags can also be set at the prompt in GHCi. @@ -310,7 +308,7 @@ data DynFlags = DynFlags { stgToDo :: Maybe [StgToDo], -- similarly hscTarget :: HscTarget, hscOutName :: String, -- ^ Name of the output file - extCoreName :: String, -- ^ Name of the .core output file + extCoreName :: String, -- ^ Name of the .hcr output file verbosity :: Int, -- ^ Verbosity level: see "DynFlags#verbosity_levels" optLevel :: Int, -- ^ Optimisation level simplPhases :: Int, -- ^ Number of simplifier phases @@ -331,7 +329,7 @@ data DynFlags = DynFlags { dphBackend :: DPHBackend, - thisPackage :: PackageId, + thisPackage :: PackageId, -- ^ name of package currently being compiled -- ways wayNames :: [WayName], -- ^ Way flags from the command line @@ -578,7 +576,7 @@ defaultDynFlags = ghcUsagePath = panic "defaultDynFlags: No ghciUsagePath", ghciUsagePath = panic "defaultDynFlags: No ghciUsagePath", topDir = panic "defaultDynFlags: No topDir", - systemPackageConfig = panic "defaultDynFlags: No systemPackageConfig", + systemPackageConfig = panic "no systemPackageConfig: call GHC.setSessionDynFlags", pgm_L = panic "defaultDynFlags: No pgm_L", pgm_P = panic "defaultDynFlags: No pgm_P", pgm_F = panic "defaultDynFlags: No pgm_F", @@ -803,7 +801,16 @@ optLevelFlags , ([2], Opt_LiberateCase) , ([2], Opt_SpecConstr) - , ([2], Opt_StaticArgumentTransformation) + +-- , ([2], Opt_StaticArgumentTransformation) +-- Max writes: I think it's probably best not to enable SAT with -O2 for the +-- 6.10 release. The version of SAT in HEAD at the moment doesn't incorporate +-- several improvements to the heuristics, and I'm concerned that without +-- those changes SAT will interfere with some attempts to write "high +-- performance Haskell", as we saw in some posts on Haskell-Cafe earlier +-- this year. In particular, the version in HEAD lacks the tail call +-- criterion, so many things that look like reasonable loops will be +-- turned into functions with extra (unneccesary) thunk creation. , ([0,1,2], Opt_DoLambdaEtaExpansion) -- This one is important for a tiresome reason: @@ -1691,8 +1698,15 @@ glasgowExtsFlags = [ -- ----------------------------------------------------------------------------- -- Parsing the dynamic flags. -parseDynamicFlags :: DynFlags -> [Located String] - -> IO (DynFlags, [Located String], [Located String]) +-- | Parse dynamic flags from a list of command line argument. Returns the +-- the parsed 'DynFlags', the left-over arguments, and a list of warnings. +-- Throws a 'UsageError' if errors occurred during parsing (such as unknown +-- flags or missing arguments). +parseDynamicFlags :: Monad m => + DynFlags -> [Located String] + -> m (DynFlags, [Located String], [Located String]) + -- ^ Updated 'DynFlags', left-over arguments, and + -- list of warnings. parseDynamicFlags dflags args = do -- XXX Legacy support code -- We used to accept things like