[project @ 1997-12-02 18:08:54 by quintela]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index e00c778..eaf8caf 100644 (file)
@@ -17,7 +17,6 @@ module CmdLineOpts (
        switchIsOn,
 
        maybe_CompilingGhcInternals,
-       opt_AllDemanded,
        opt_AllStrict,
        opt_AutoSccsOnAllToplevs,
        opt_AutoSccsOnExportedToplevs,
@@ -25,7 +24,6 @@ module CmdLineOpts (
        opt_CompilingGhcInternals,
        opt_D_dump_absC,
        opt_D_dump_asm,
-       opt_D_dump_deforest,
        opt_D_dump_deriv,
        opt_D_dump_ds,
        opt_D_dump_flatC,
@@ -52,20 +50,16 @@ module CmdLineOpts (
        opt_DoTickyProfiling,
        opt_EnsureSplittableC,
        opt_FoldrBuildOn,
-       opt_FoldrBuildTrace,
        opt_ForConcurrent,
        opt_GlasgowExts,
        opt_GranMacros,
        opt_HiMap,
        opt_IgnoreIfacePragmas,
-       opt_IgnoreStrictnessPragmas,
-       opt_IrrefutableEverything,
        opt_IrrefutableTuples,
        opt_LiberateCaseThreshold,
        opt_NoImplicitPrelude,
        opt_NumbersStrict,
        opt_OmitBlackHoling,
-       opt_OmitDefaultInstanceMethods,
        opt_OmitInterfacePragmas,
        opt_PprStyle_All,
        opt_PprStyle_Debug,
@@ -79,7 +73,6 @@ module CmdLineOpts (
        opt_SccGroup,
        opt_SccProfilingOn,
        opt_ShowImportSpecs,
-       opt_ShowPragmaNameErrs,
        opt_SigsRequired,
        opt_SourceUnchanged,
        opt_SpecialiseAll,
@@ -93,11 +86,14 @@ module CmdLineOpts (
        opt_UnfoldingCreationThreshold,
        opt_UnfoldingConDiscount,
        opt_UnfoldingUseThreshold,
+       opt_UnfoldingKeenessFactor,
 
        opt_Verbose,
        opt_WarnNameShadowing,
        opt_WarnUnusedNames,
-       opt_WarnIncompletePatterns, opt_WarnOverlappedPatterns,
+       opt_WarnIncompletePatterns, opt_WarnOverlappedPatterns, opt_WarnSimplePatterns,
+       opt_WarnMissingMethods,
+       opt_WarnDuplicateExports,
        opt_PruneTyDecls, opt_PruneInstDecls,
        opt_D_show_unused_imports,
        opt_D_show_rn_stats,
@@ -111,6 +107,9 @@ import PreludeGlaST -- bad bad bad boy, Will (_Array internals)
 #else
 import GlaExts
 import ArrBase
+#if __GLASGOW_HASKELL__ >= 209
+import Addr
+#endif
 -- 2.04 and later exports Lift from GlaExts
 #if __GLASGOW_HASKELL__ < 204
 import PrelBase (Lift(..))
@@ -170,7 +169,6 @@ data CoreToDo               -- These are diff core-to-core passes,
   | CoreDoStaticArgs
   | CoreDoStrictness
   | CoreDoSpecialising
-  | CoreDoDeforest
   | CoreDoFoldrBuildWorkerWrapper
   | CoreDoFoldrBuildWWAnal
 \end{code}
@@ -248,10 +246,11 @@ data SimplifierSwitch
 %************************************************************************
 
 \begin{code}
-lookUp        :: FAST_STRING -> Bool
-lookup_int     :: String -> Maybe Int
-lookup_def_int :: String -> Int -> Int
-lookup_str     :: String -> Maybe String
+lookUp          :: FAST_STRING -> Bool
+lookup_int              :: String -> Maybe Int
+lookup_def_int   :: String -> Int -> Int
+lookup_def_float :: String -> Float -> Float
+lookup_str       :: String -> Maybe String
 
 lookUp     sw = maybeToBool (assoc_opts sw)
        
@@ -265,12 +264,15 @@ lookup_def_int sw def = case (lookup_str sw) of
                            Nothing -> def              -- Use default
                            Just xx -> read xx
 
+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
 \end{code}
 
 \begin{code}
-opt_AllDemanded                        = lookUp  SLIT("-fall-demanded")
 opt_AllStrict                  = lookUp  SLIT("-fall-strict")
 opt_AutoSccsOnAllToplevs       = lookUp  SLIT("-fauto-sccs-on-all-toplevs")
 opt_AutoSccsOnExportedToplevs  = lookUp  SLIT("-fauto-sccs-on-exported-toplevs")
@@ -279,7 +281,6 @@ opt_CompilingGhcInternals   = maybeToBool maybe_CompilingGhcInternals
 maybe_CompilingGhcInternals    = lookup_str "-fcompiling-ghc-internals="
 opt_D_dump_absC                        = lookUp  SLIT("-ddump-absC")
 opt_D_dump_asm                 = lookUp  SLIT("-ddump-asm")
-opt_D_dump_deforest            = lookUp  SLIT("-ddump-deforest")
 opt_D_dump_deriv               = lookUp  SLIT("-ddump-deriv")
 opt_D_dump_ds                  = lookUp  SLIT("-ddump-ds")
 opt_D_dump_flatC               = lookUp  SLIT("-ddump-flatC")
@@ -306,20 +307,16 @@ opt_DoTickyProfiling              = lookUp  SLIT("-fticky-ticky")
 opt_DoEtaReduction             = lookUp  SLIT("-fdo-eta-reduction")
 opt_EnsureSplittableC          = lookUp  SLIT("-fglobalise-toplev-names")
 opt_FoldrBuildOn               = lookUp  SLIT("-ffoldr-build-on")
-opt_FoldrBuildTrace            = lookUp  SLIT("-ffoldr-build-trace")
 opt_ForConcurrent              = lookUp  SLIT("-fconcurrent")
 opt_GranMacros                 = lookUp  SLIT("-fgransim")
 opt_GlasgowExts                        = lookUp  SLIT("-fglasgow-exts")
 --UNUSED:opt_Haskell_1_3       = lookUp  SLIT("-fhaskell-1.3")
 opt_HiMap                      = lookup_str "-himap="  -- file saying where to look for .hi files
 opt_IgnoreIfacePragmas         = lookUp  SLIT("-fignore-interface-pragmas")
-opt_IgnoreStrictnessPragmas    = lookUp  SLIT("-fignore-strictness-pragmas")
-opt_IrrefutableEverything      = lookUp  SLIT("-firrefutable-everything")
 opt_IrrefutableTuples          = lookUp  SLIT("-firrefutable-tuples")
 opt_NoImplicitPrelude          = lookUp  SLIT("-fno-implicit-prelude")
 opt_NumbersStrict              = lookUp  SLIT("-fnumbers-strict")
 opt_OmitBlackHoling            = lookUp  SLIT("-dno-black-holing")
-opt_OmitDefaultInstanceMethods = lookUp  SLIT("-fomit-default-instance-methods")
 opt_OmitInterfacePragmas       = lookUp  SLIT("-fomit-interface-pragmas")
 opt_PprStyle_All               = lookUp  SLIT("-dppr-all")
 opt_PprStyle_Debug             = lookUp  SLIT("-dppr-debug")
@@ -331,7 +328,6 @@ opt_ProduceHi                       = lookup_str "-hifile=" -- the one to produce this time
 opt_ReportWhyUnfoldingsDisallowed= lookUp SLIT("-freport-disallowed-unfoldings")
 opt_SccProfilingOn             = lookUp  SLIT("-fscc-profiling")
 opt_ShowImportSpecs            = lookUp  SLIT("-fshow-import-specs")
-opt_ShowPragmaNameErrs         = lookUp  SLIT("-fshow-pragma-name-errs")
 opt_SigsRequired               = lookUp  SLIT("-fsignatures-required")
 opt_SourceUnchanged            = lookUp  SLIT("-fsource-unchanged")
 opt_SpecialiseAll              = lookUp  SLIT("-fspecialise-all")
@@ -350,10 +346,14 @@ opt_UnfoldingUseThreshold = lookup_def_int "-funfolding-use-threshold"       uNFOLD
 opt_UnfoldingConDiscount       = lookup_def_int "-funfolding-con-discount"        uNFOLDING_CON_DISCOUNT_WEIGHT
                        
 opt_LiberateCaseThreshold      = lookup_def_int "-fliberate-case-threshold"       lIBERATE_CASE_THRESHOLD
+opt_UnfoldingKeenessFactor     = lookup_def_float "-funfolding-keeness-factor"    uNFOLDING_KEENESS_FACTOR
 opt_WarnNameShadowing          = lookUp  SLIT("-fwarn-name-shadowing")
-opt_WarnIncompletePatterns     = not (lookUp  SLIT("-fno-warn-incomplete-patterns"))
-opt_WarnOverlappedPatterns     = not (lookUp  SLIT("-fno-warn-overlapped-patterns"))
+opt_WarnIncompletePatterns     = lookUp  SLIT("-fwarn-incomplete-patterns")
+opt_WarnOverlappedPatterns     = lookUp  SLIT("-fwarn-overlapped-patterns")
+opt_WarnSimplePatterns         = lookUp  SLIT("-fwarn-simple-patterns")
 opt_WarnUnusedNames            = lookUp  SLIT("-fwarn-unused-names")
+opt_WarnMissingMethods         = lookUp  SLIT("-fwarn-missing-methods")
+opt_WarnDuplicateExports       = lookUp  SLIT("-fwarn-duplicate-exports")
 opt_PruneTyDecls               = not (lookUp SLIT("-fno-prune-tydecls"))
 opt_PruneInstDecls             = not (lookUp SLIT("-fno-prune-instdecls"))
 opt_D_show_unused_imports      = lookUp SLIT("-dshow-unused-imports")
@@ -412,7 +412,6 @@ classifyOpts = sep argv [] [] -- accumulators...
          "-fstatic-args"    -> CORE_TD(CoreDoStaticArgs)
          "-fstrictness"     -> CORE_TD(CoreDoStrictness)
          "-fspecialise"     -> CORE_TD(CoreDoSpecialising)
-         "-fdeforest"       -> CORE_TD(CoreDoDeforest)
          "-ffoldr-build-worker-wrapper"  -> CORE_TD(CoreDoFoldrBuildWorkerWrapper)
          "-ffoldr-build-ww-anal"  -> CORE_TD(CoreDoFoldrBuildWWAnal)