[project @ 2001-12-17 12:32:05 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index 10a9885..5cf3ce3 100644 (file)
@@ -8,7 +8,7 @@
 module CmdLineOpts (
        CoreToDo(..), StgToDo(..),
        SimplifierSwitch(..), 
-       SimplifierMode(..),
+       SimplifierMode(..), FloatOutSwitches(..),
 
        HscLang(..),
        DynFlag(..),    -- needed non-abstractly by DriverFlags
@@ -114,7 +114,6 @@ module CmdLineOpts (
 
 import GlaExts
 import IOExts  ( IORef, readIORef, writeIORef )
-import BasicTypes      ( CompilerPhase )
 import Constants       -- Default values for some flags
 import Util
 import FastTypes
@@ -173,7 +172,7 @@ data CoreToDo               -- These are diff core-to-core passes,
                        -- Each run of the simplifier can take a different
                        -- set of simplifier-specific flags.
   | CoreDoFloatInwards
-  | CoreDoFloatOutwards Bool   -- True <=> float lambdas to top level
+  | CoreDoFloatOutwards FloatOutSwitches
   | CoreLiberateCase
   | CoreDoPrintCore
   | CoreDoStaticArgs
@@ -185,7 +184,7 @@ data CoreToDo               -- These are diff core-to-core passes,
   | CoreDoCPResult
   | CoreDoGlomBinds
   | CoreCSE
-  | CoreDoRuleCheck CompilerPhase String       -- Check for non-application of rules 
+  | CoreDoRuleCheck Int{-CompilerPhase-} String        -- Check for non-application of rules 
                                                -- matching this string
 
   | CoreDoNothing       -- useful when building up lists of these things
@@ -207,6 +206,11 @@ data SimplifierMode                -- See comments in SimplMonad
 data SimplifierSwitch
   = MaxSimplifierIterations Int
   | NoCaseOfCase
+
+data FloatOutSwitches
+  = FloatOutSw  Bool   -- True <=> float lambdas to top level
+               Bool    -- True <=> float constants to top level,
+                       --          even if they do not escape a lambda
 \end{code}
 
 %************************************************************************
@@ -234,7 +238,7 @@ data DynFlag
    | Opt_D_dump_simpl
    | Opt_D_dump_simpl_iterations
    | Opt_D_dump_spec
-   | Opt_D_dump_sat
+   | Opt_D_dump_prep
    | Opt_D_dump_stg
    | Opt_D_dump_stranal
    | Opt_D_dump_tc
@@ -294,12 +298,14 @@ data DynFlags = DynFlags {
   extCoreName          :: String,      -- name of the .core output file
   verbosity            :: Int,         -- verbosity level
   cppFlag              :: Bool,        -- preprocess with cpp?
+  ppFlag                :: Bool,        -- preprocess with a Haskell Pp?
   stolen_x86_regs      :: Int,         
   cmdlineHcIncludes    :: [String],    -- -#includes
 
   -- options for particular phases
   opt_L                        :: [String],
   opt_P                        :: [String],
+  opt_F                        :: [String],
   opt_c                        :: [String],
   opt_a                        :: [String],
   opt_m                        :: [String],
@@ -329,10 +335,12 @@ defaultDynFlags = DynFlags {
   extCoreName = "",
   verbosity = 0, 
   cppFlag              = False,
+  ppFlag                = False,
   stolen_x86_regs      = 4,
   cmdlineHcIncludes    = [],
   opt_L                        = [],
   opt_P                        = [],
+  opt_F                 = [],
   opt_c                        = [],
   opt_a                        = [],
   opt_m                        = [],