[project @ 1999-12-09 12:30:56 by simonpj]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index 63d4632..2d105bd 100644 (file)
@@ -87,13 +87,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 +103,6 @@ module CmdLineOpts (
        opt_SimplDoLambdaEtaExpansion,
        opt_SimplCaseOfCase,
        opt_SimplCaseMerge,
-       opt_SimplLetToCase,
        opt_SimplPedanticBottoms,
 
        -- Unfolding control
@@ -235,6 +234,8 @@ data StgToDo
 data SimplifierSwitch
   = MaxSimplifierIterations Int
   | SimplInlinePhase Int
+  | DontApplyRules
+  | SimplLetToCase
 \end{code}
 
 %************************************************************************
@@ -312,7 +313,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")
@@ -375,13 +376,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 +422,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 +531,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 +565,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 +599,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