[project @ 2000-10-05 11:15:20 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index ccaeac8..69f7c24 100644 (file)
@@ -25,6 +25,7 @@ module CmdLineOpts (
        opt_D_dump_ds,
        opt_D_dump_flatC,
        opt_D_dump_foreign,
+       opt_D_dump_hi_diffs,
        opt_D_dump_inlinings,
        opt_D_dump_occur_anal,
        opt_D_dump_parsed,
@@ -38,6 +39,7 @@ module CmdLineOpts (
        opt_D_dump_stg,
        opt_D_dump_stranal,
        opt_D_dump_tc,
+       opt_D_dump_types,
         opt_D_dump_usagesp,
        opt_D_dump_worker_wrapper,
        opt_D_show_passes,
@@ -86,6 +88,7 @@ module CmdLineOpts (
         opt_AllowOverlappingInstances,
        opt_AllowUndecidableInstances,
        opt_GlasgowExts,
+       opt_Generics,
        opt_IrrefutableTuples,
        opt_NumbersStrict,
        opt_Parallel,
@@ -106,15 +109,15 @@ module CmdLineOpts (
        opt_SimplCaseOfCase,
        opt_SimplCaseMerge,
        opt_SimplPedanticBottoms,
+       opt_SimplExcessPrecision,
 
        -- Unfolding control
        opt_UF_HiFileThreshold,
        opt_UF_CreationThreshold,
        opt_UF_UseThreshold,
-       opt_UF_ScrutConDiscount,
        opt_UF_FunAppDiscount,
-       opt_UF_PrimArgDiscount,
        opt_UF_KeenessFactor,
+       opt_UF_UpdateInPlace,
        opt_UF_CheapOp,
        opt_UF_DearOp,
 
@@ -135,7 +138,10 @@ module CmdLineOpts (
        opt_OmitInterfacePragmas,
        opt_ProduceExportCStubs,
        opt_ProduceExportHStubs,
-       opt_ProduceHi,
+       opt_HiFile,
+       opt_HiDir,
+       opt_HiSuf,
+       opt_NoPruneTyDecls,
        opt_NoPruneDecls,
        opt_ReportCompile,
        opt_SourceUnchanged,
@@ -161,7 +167,7 @@ import Argv
 import Constants       -- Default values for some flags
 
 import FastString      ( headFS )
-import Maybes          ( assocMaybe, firstJust, maybeToBool )
+import Maybes          ( firstJust, maybeToBool )
 import Panic           ( panic, panic# )
 
 #if __GLASGOW_HASKELL__ < 301
@@ -217,6 +223,7 @@ data CoreToDo               -- These are diff core-to-core passes,
   | CoreDoSpecialising
   | CoreDoUSPInf
   | CoreDoCPResult 
+  | CoreDoGlomBinds
   | CoreCSE
 \end{code}
 
@@ -252,7 +259,7 @@ lookup_def_int   :: String -> Int -> Int
 lookup_def_float :: String -> Float -> Float
 lookup_str       :: String -> Maybe String
 
-lookUp     sw = maybeToBool (assoc_opts sw)
+lookUp     sw = sw `elem` argv
        
 lookup_str sw = firstJust (map (startsWith sw) unpacked_opts)
 
@@ -272,7 +279,6 @@ lookup_def_float sw def = case (lookup_str sw) of
                            Nothing -> def              -- Use default
                            Just xx -> read xx
 
-assoc_opts    = assocMaybe [ (a, True) | a <- argv ]
 unpacked_opts = map _UNPK_ argv
 
 {-
@@ -281,8 +287,6 @@ unpacked_opts = map _UNPK_ argv
  a pure Win32 application where I think there's a command-line
  length limit of 255. unpacked_opts understands the @ option.
 
-assoc_opts    = assocMaybe [ (_PK_ a, True) | a <- unpacked_opts ]
-
 unpacked_opts :: [String]
 unpacked_opts =
   concat $
@@ -324,6 +328,7 @@ opt_D_dump_spec                     = opt_D_dump_most || lookUp  SLIT("-ddump-spec")
 opt_D_dump_stg                 = opt_D_dump_most || lookUp  SLIT("-ddump-stg")
 opt_D_dump_stranal             = opt_D_dump_most || lookUp  SLIT("-ddump-stranal")
 opt_D_dump_tc                  = opt_D_dump_most || lookUp  SLIT("-ddump-tc")
+opt_D_dump_types               = opt_D_dump_most || lookUp  SLIT("-ddump-types")
 opt_D_dump_rules               = opt_D_dump_most || lookUp  SLIT("-ddump-rules")
 opt_D_dump_usagesp              = opt_D_dump_most || lookUp  SLIT("-ddump-usagesp")
 opt_D_dump_cse                         = opt_D_dump_most || lookUp  SLIT("-ddump-cse")
@@ -336,6 +341,8 @@ opt_D_dump_simpl_stats              = opt_D_dump_most || lookUp  SLIT("-ddump-simpl-stats")
 opt_D_source_stats             = opt_D_dump_most || lookUp  SLIT("-dsource-stats")
 opt_D_verbose_core2core                = opt_D_dump_all  || lookUp  SLIT("-dverbose-simpl")
 opt_D_verbose_stg2stg          = opt_D_dump_all  || lookUp  SLIT("-dverbose-stg")
+opt_D_dump_hi_diffs            = opt_D_dump_all  || lookUp  SLIT("-ddump-hi-diffs")
+
 opt_D_dump_minimal_imports     = lookUp  SLIT("-ddump-minimal-imports")
 
 opt_DoCoreLinting              = lookUp  SLIT("-dcore-lint")
@@ -375,6 +382,7 @@ opt_DictsStrict                     = lookUp  SLIT("-fdicts-strict")
 opt_AllowOverlappingInstances   = lookUp  SLIT("-fallow-overlapping-instances")
 opt_AllowUndecidableInstances  = lookUp  SLIT("-fallow-undecidable-instances")
 opt_GlasgowExts                        = lookUp  SLIT("-fglasgow-exts")
+opt_Generics                   = lookUp  SLIT("-fgenerics")
 opt_IrrefutableTuples          = lookUp  SLIT("-firrefutable-tuples")
 opt_MaxContextReductionDepth   = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
 opt_NumbersStrict              = lookUp  SLIT("-fnumbers-strict")
@@ -415,7 +423,11 @@ opt_OmitBlackHoling                = lookUp  SLIT("-dno-black-holing")
 opt_OmitInterfacePragmas       = lookUp  SLIT("-fomit-interface-pragmas")
 opt_ProduceExportCStubs                = lookup_str "-F="
 opt_ProduceExportHStubs                = lookup_str "-FH="
-opt_ProduceHi                  = lookup_str "-hifile=" -- the one to produce this time 
+
+-- where to generate the .hi file
+opt_HiFile                     = lookup_str "-hifile="
+opt_HiDir                      = lookup_str "-hidir="
+opt_HiSuf                      = lookup_str "-hisuf="
 
 -- Language for output: "C", "asm", "java", maybe more
 -- Nothing => don't output anything
@@ -436,21 +448,22 @@ opt_SimplDoLambdaEtaExpansion     = lookUp SLIT("-fdo-lambda-eta-expansion")
 opt_SimplCaseOfCase            = lookUp SLIT("-fcase-of-case")
 opt_SimplCaseMerge             = lookUp SLIT("-fcase-merge")
 opt_SimplPedanticBottoms       = lookUp SLIT("-fpedantic-bottoms")
+opt_SimplExcessPrecision       = lookUp SLIT("-fexcess-precision")
 
 -- Unfolding control
 opt_UF_HiFileThreshold         = lookup_def_int "-funfolding-interface-threshold" (45::Int)
 opt_UF_CreationThreshold       = lookup_def_int "-funfolding-creation-threshold"  (45::Int)
 opt_UF_UseThreshold            = lookup_def_int "-funfolding-use-threshold"       (8::Int)     -- Discounts can be big
-opt_UF_ScrutConDiscount                = lookup_def_int "-funfolding-con-discount"        (2::Int)
 opt_UF_FunAppDiscount          = lookup_def_int "-funfolding-fun-discount"        (6::Int)     -- It's great to inline a fn
-opt_UF_PrimArgDiscount         = lookup_def_int "-funfolding-prim-discount"       (1::Int)
 opt_UF_KeenessFactor           = lookup_def_float "-funfolding-keeness-factor"    (1.5::Float)
+opt_UF_UpdateInPlace           = lookUp  SLIT("-funfolding-update-in-place")
 
 opt_UF_CheapOp  = ( 1 :: Int)  -- Only one instruction; and the args are charged for
 opt_UF_DearOp   = ( 4 :: Int)
                        
 opt_ReportCompile               = lookUp SLIT("-freport-compile")
 opt_NoPruneDecls               = lookUp SLIT("-fno-prune-decls")
+opt_NoPruneTyDecls             = lookUp SLIT("-fno-prune-tydecls")
 opt_SourceUnchanged            = lookUp SLIT("-fsource-unchanged")
 opt_Static                     = lookUp SLIT("-static")
 opt_Unregisterised             = lookUp SLIT("-funregisterised")
@@ -494,6 +507,7 @@ classifyOpts = sep argv [] [] -- accumulators...
          "-ffloat-outwards-full" -> CORE_TD(CoreDoFloatOutwards True)
          "-fliberate-case"  -> CORE_TD(CoreLiberateCase)
          "-fcse"            -> CORE_TD(CoreCSE)
+         "-fglom-binds"     -> CORE_TD(CoreDoGlomBinds)
          "-fprint-core"     -> CORE_TD(CoreDoPrintCore)
          "-fstatic-args"    -> CORE_TD(CoreDoStaticArgs)
          "-fstrictness"     -> CORE_TD(CoreDoStrictness)