Merge the smp and threaded RTS ways
[ghc-hetmet.git] / ghc / compiler / main / StaticFlags.hs
index 0bce0d1..3067063 100644 (file)
@@ -32,7 +32,6 @@ module StaticFlags (
         opt_MaxContextReductionDepth,
        opt_IrrefutableTuples,
        opt_Parallel,
-       opt_SMP,
        opt_RuntimeTypes,
        opt_Flatten,
 
@@ -58,7 +57,6 @@ module StaticFlags (
        opt_IgnoreDotGhci,
        opt_ErrorSpans,
        opt_EmitCExternDecls,
-       opt_SplitObjs,
        opt_GranMacros,
        opt_HiVersion,
        opt_HistorySize,
@@ -72,7 +70,6 @@ module StaticFlags (
 
 #include "HsVersions.h"
 
-import DriverPhases
 import Util            ( consIORef )
 import CmdLineParser
 import Config          ( cProjectVersionInt, cProjectPatchLevel,
@@ -88,7 +85,6 @@ import DATA_IOREF
 import UNSAFE_IO       ( unsafePerformIO )
 import Monad           ( when )
 import Char            ( isDigit )
-import IO              ( hPutStrLn, stderr ) -- ToDo: should use errorMsg
 import List            ( sort, intersperse )
 
 -----------------------------------------------------------------------------
@@ -128,7 +124,7 @@ static_flags = [
   ,  ( "ticky"         , NoArg (addWay WayTicky) )
   ,  ( "parallel"      , NoArg (addWay WayPar) )
   ,  ( "gransim"       , NoArg (addWay WayGran) )
-  ,  ( "smp"           , NoArg (addWay WaySMP) )
+  ,  ( "smp"           , NoArg (addWay WayThreaded) ) -- backwards compat.
   ,  ( "debug"         , NoArg (addWay WayDebug) )
   ,  ( "ndp"           , NoArg (addWay WayNDP) )
   ,  ( "threaded"      , NoArg (addWay WayThreaded) )
@@ -153,12 +149,6 @@ static_flags = [
        ------- Miscellaneous -----------------------------------------------
   ,  ( "no-link-chk"    , NoArg (return ()) ) -- ignored for backwards compat
 
-  ,  ( "split-objs"    , NoArg (if can_split
-                                   then addOpt "-split-objs"
-                                   else hPutStrLn stderr
-                                           "warning: don't know how to split object files on this architecture"
-                               ) )
-
        ----- Linker --------------------------------------------------------
   ,  ( "static"        , PassFlag addOpt )
   ,  ( "dynamic"        , NoArg (removeOpt "-static") )
@@ -265,7 +255,6 @@ opt_DictsStrict                     = lookUp  FSLIT("-fdicts-strict")
 opt_IrrefutableTuples          = lookUp  FSLIT("-firrefutable-tuples")
 opt_MaxContextReductionDepth   = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
 opt_Parallel                   = lookUp  FSLIT("-fparallel")
-opt_SMP                                = lookUp  FSLIT("-fsmp")
 opt_Flatten                    = lookUp  FSLIT("-fflatten")
 
 -- optimisation opts
@@ -278,7 +267,6 @@ opt_LiberateCaseThreshold   = lookup_def_int "-fliberate-case-threshold" (10::Int)
 opt_MaxWorkerArgs              = lookup_def_int "-fmax-worker-args" (10::Int)
 
 opt_EmitCExternDecls           = lookUp  FSLIT("-femit-extern-decls")
-opt_SplitObjs                  = lookUp  FSLIT("-split-objs")
 opt_GranMacros                 = lookUp  FSLIT("-fgransim")
 opt_HiVersion                  = read (cProjectVersionInt ++ cProjectPatchLevel) :: Int
 opt_HistorySize                        = lookup_def_int "-fhistory-size" 20
@@ -325,7 +313,6 @@ isStaticFlag f =
        "fdicts-strict",
        "firrefutable-tuples",
        "fparallel",
-       "fsmp",
        "fflatten",
        "fsemi-tagging",
        "flet-no-escape",
@@ -399,24 +386,6 @@ foreign import "setHeapSize"       unsafe setHeapSize       :: Int -> IO ()
 foreign import "enableTimingStats" unsafe enableTimingStats :: IO ()
 #endif
 
--- -----------------------------------------------------------------------------
--- Splitting
-
-can_split :: Bool
-can_split =  
-#if    defined(i386_TARGET_ARCH)     \
-    || defined(alpha_TARGET_ARCH)    \
-    || defined(hppa_TARGET_ARCH)     \
-    || defined(m68k_TARGET_ARCH)     \
-    || defined(mips_TARGET_ARCH)     \
-    || defined(powerpc_TARGET_ARCH)  \
-    || defined(rs6000_TARGET_ARCH)   \
-    || defined(sparc_TARGET_ARCH) 
-   True
-#else
-   False
-#endif
-
 -----------------------------------------------------------------------------
 -- Ways
 
@@ -447,7 +416,6 @@ data WayName
   | WayTicky
   | WayPar
   | WayGran
-  | WaySMP
   | WayNDP
   | WayUser_a
   | WayUser_b
@@ -483,7 +451,6 @@ allowed_combination way = and [ x `allowedWith` y
 
        WayThreaded `allowedWith` WayProf       = True
        WayProf `allowedWith` WayUnreg          = True
-       WayProf `allowedWith` WaySMP            = True
        WayProf `allowedWith` WayNDP            = True
        _ `allowedWith` _                       = False
 
@@ -535,14 +502,12 @@ way_details =
     (WayProf, Way  "p" False "Profiling"
        [ "-fscc-profiling"
        , "-DPROFILING"
-       , "-optc-DPROFILING"
-       , "-fvia-C" ]),
+       , "-optc-DPROFILING" ]),
 
     (WayTicky, Way  "t" False "Ticky-ticky Profiling"  
        [ "-fticky-ticky"
        , "-DTICKY_TICKY"
-       , "-optc-DTICKY_TICKY"
-       , "-fvia-C" ]),
+       , "-optc-DTICKY_TICKY" ]),
 
     (WayUnreg, Way  "u" False "Unregisterised" 
        unregFlags ),
@@ -556,8 +521,7 @@ way_details =
         , "-optc-w"
         , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
         , "-optl-lpvm3"
-        , "-optl-lgpvm3"
-       , "-fvia-C" ]),
+        , "-optl-lgpvm3" ]),
 
     -- at the moment we only change the RTS and could share compiler and libs!
     (WayPar, Way  "mt" False "Parallel ticky profiling" 
@@ -569,8 +533,7 @@ way_details =
         , "-optc-w"
         , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
         , "-optl-lpvm3"
-        , "-optl-lgpvm3"
-       , "-fvia-C" ]),
+        , "-optl-lgpvm3" ]),
 
     (WayPar, Way  "md" False "Distributed" 
        [ "-fparallel"
@@ -582,24 +545,13 @@ way_details =
         , "-optc-w"
         , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
         , "-optl-lpvm3"
-        , "-optl-lgpvm3"
-       , "-fvia-C" ]),
+        , "-optl-lgpvm3" ]),
 
     (WayGran, Way  "mg" False "GranSim"
        [ "-fgransim"
        , "-D__GRANSIM__"
        , "-optc-DGRAN"
-       , "-package concurrent"
-       , "-fvia-C" ]),
-
-    (WaySMP, Way  "s" False "SMP"
-       [ "-fsmp"
-       , "-optc-pthread"
-#ifndef freebsd_TARGET_OS
-       , "-optl-pthread"
-#endif
-       , "-optc-DSMP"
-       , "-fvia-C" ]),
+       , "-package concurrent" ]),
 
     (WayNDP, Way  "ndp" False "Nested data parallelism"
        [ "-fparr"