[project @ 2000-02-25 14:55:31 by panne]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index 63d4632..44b652c 100644 (file)
@@ -43,6 +43,7 @@ module CmdLineOpts (
        opt_D_show_passes,
        opt_D_dump_rn_trace,
        opt_D_dump_rn_stats,
+        opt_D_dump_stix,
        opt_D_source_stats,
        opt_D_verbose_core2core,
        opt_D_verbose_stg2stg,
@@ -67,6 +68,7 @@ module CmdLineOpts (
        opt_WarnUnusedBinds,
        opt_WarnUnusedImports,
        opt_WarnUnusedMatches,
+       opt_WarnDeprecations,
 
        -- profiling opts
        opt_AutoSccsOnAllToplevs,
@@ -87,13 +89,13 @@ module CmdLineOpts (
        opt_IrrefutableTuples,
        opt_NumbersStrict,
        opt_Parallel,
+       opt_SMP,
 
        -- optimisation opts
        opt_DoEtaReduction,
        opt_DoSemiTagging,
        opt_FoldrBuildOn,
        opt_LiberateCaseThreshold,
-       opt_NoPreInlining,
        opt_StgDoLetNoEscapes,
        opt_UnfoldCasms,
         opt_UsageSPOn,
@@ -103,7 +105,6 @@ module CmdLineOpts (
        opt_SimplDoLambdaEtaExpansion,
        opt_SimplCaseOfCase,
        opt_SimplCaseMerge,
-       opt_SimplLetToCase,
        opt_SimplPedanticBottoms,
 
        -- Unfolding control
@@ -235,6 +236,8 @@ data StgToDo
 data SimplifierSwitch
   = MaxSimplifierIterations Int
   | SimplInlinePhase Int
+  | DontApplyRules
+  | SimplLetToCase
 \end{code}
 
 %************************************************************************
@@ -312,7 +315,7 @@ opt_D_dump_ds                       = opt_D_dump_most || lookUp  SLIT("-ddump-ds")
 opt_D_dump_flatC               = opt_D_dump_all  || lookUp  SLIT("-ddump-flatC")
 opt_D_dump_foreign             = opt_D_dump_most || lookUp  SLIT("-ddump-foreign-stubs")
 opt_D_dump_inlinings           = opt_D_dump_all  || lookUp  SLIT("-ddump-inlinings")
-opt_D_dump_occur_anal          = opt_D_dump_most || lookUp  SLIT("-ddump-occur-anal")
+opt_D_dump_occur_anal          = opt_D_dump_all  || lookUp  SLIT("-ddump-occur-anal")
 opt_D_dump_parsed              = opt_D_dump_most || lookUp  SLIT("-ddump-parsed")
 opt_D_dump_realC               = opt_D_dump_all  || lookUp  SLIT("-ddump-realC")
 opt_D_dump_rn                  = opt_D_dump_most || lookUp  SLIT("-ddump-rn")
@@ -329,6 +332,7 @@ opt_D_dump_worker_wrapper   = opt_D_dump_most || lookUp  SLIT("-ddump-workwrap")
 opt_D_show_passes              = opt_D_dump_most || lookUp  SLIT("-dshow-passes")
 opt_D_dump_rn_trace            = opt_D_dump_all  || lookUp  SLIT("-ddump-rn-trace")
 opt_D_dump_rn_stats            = opt_D_dump_most || lookUp  SLIT("-ddump-rn-stats")
+opt_D_dump_stix                = opt_D_dump_all  || lookUp  SLIT("-ddump-stix")
 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")
@@ -355,6 +359,7 @@ opt_WarnTypeDefaults                = lookUp  SLIT("-fwarn-type-defaults")
 opt_WarnUnusedBinds            = lookUp  SLIT("-fwarn-unused-binds")
 opt_WarnUnusedImports          = lookUp  SLIT("-fwarn-unused-imports")
 opt_WarnUnusedMatches          = lookUp  SLIT("-fwarn-unused-matches")
+opt_WarnDeprecations           = lookUp  SLIT("-fwarn-deprecations")
 
 -- profiling opts
 opt_AutoSccsOnAllToplevs       = lookUp  SLIT("-fauto-sccs-on-all-toplevs")
@@ -375,13 +380,13 @@ opt_IrrefutableTuples             = lookUp  SLIT("-firrefutable-tuples")
 opt_MaxContextReductionDepth   = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
 opt_NumbersStrict              = lookUp  SLIT("-fnumbers-strict")
 opt_Parallel                   = lookUp  SLIT("-fparallel")
+opt_SMP                                = lookUp  SLIT("-fsmp")
 
 -- optimisation opts
 opt_DoEtaReduction             = lookUp  SLIT("-fdo-eta-reduction")
 opt_DoSemiTagging              = lookUp  SLIT("-fsemi-tagging")
 opt_FoldrBuildOn               = lookUp  SLIT("-ffoldr-build-on")
 opt_LiberateCaseThreshold      = lookup_def_int "-fliberate-case-threshold" (10::Int)
-opt_NoPreInlining              = lookUp  SLIT("-fno-pre-inlining")
 opt_StgDoLetNoEscapes          = lookUp  SLIT("-flet-no-escape")
 opt_UnfoldCasms                        = lookUp SLIT("-funfold-casms-in-hi-file")
 opt_UsageSPOn                  = lookUp  SLIT("-fusagesp-on")
@@ -421,7 +426,6 @@ opt_SimplDoEtaReduction             = lookUp SLIT("-fdo-eta-reduction")
 opt_SimplDoLambdaEtaExpansion  = lookUp SLIT("-fdo-lambda-eta-expansion")
 opt_SimplCaseOfCase            = lookUp SLIT("-fcase-of-case")
 opt_SimplCaseMerge             = lookUp SLIT("-fcase-merge")
-opt_SimplLetToCase             = lookUp SLIT("-flet-to-case")
 opt_SimplPedanticBottoms       = lookUp SLIT("-fpedantic-bottoms")
 
 -- Unfolding control
@@ -531,6 +535,8 @@ classifyOpts = sep argv [] [] -- accumulators...
 matchSimplSw opt
   = firstJust  [ matchSwInt  opt "-fmax-simplifier-iterations"         MaxSimplifierIterations
                , matchSwInt  opt "-finline-phase"                      SimplInlinePhase
+               , matchSwBool opt "-fno-rules"                          DontApplyRules
+               , matchSwBool opt "-flet-to-case"                       SimplLetToCase
                ]
 
 matchSwBool :: String -> String -> a -> Maybe a
@@ -563,10 +569,12 @@ instance Ord SimplifierSwitch where
 
 tagOf_SimplSwitch (SimplInlinePhase _)         = ILIT(1)
 tagOf_SimplSwitch (MaxSimplifierIterations _)  = ILIT(2)
+tagOf_SimplSwitch DontApplyRules               = ILIT(3)
+tagOf_SimplSwitch SimplLetToCase               = ILIT(4)
 
 -- If you add anything here, be sure to change lAST_SIMPL_SWITCH_TAG, too!
 
-lAST_SIMPL_SWITCH_TAG = 2
+lAST_SIMPL_SWITCH_TAG = 4
 \end{code}
 
 %************************************************************************
@@ -595,7 +603,11 @@ isAmongSimpl on_switches           -- Switches mentioned later occur *earlier*
        defined_elems = map mk_assoc_elem tidied_on_switches
     in
     -- (avoid some unboxing, bounds checking, and other horrible things:)
+#if __GLASGOW_HASKELL__ < 405
     case sw_tbl of { Array bounds_who_needs_'em stuff ->
+#else
+    case sw_tbl of { Array _ _ stuff ->
+#endif
     \ switch ->
        case (indexArray# stuff (tagOf_SimplSwitch switch)) of
 #if __GLASGOW_HASKELL__ < 400