Minor refactoring of placeHolderPunRhs
[ghc-hetmet.git] / compiler / main / StaticFlagParser.hs
index a153435..b0b3761 100644 (file)
@@ -107,7 +107,6 @@ static_flags = [
         ------- ways --------------------------------------------------------
   , Flag "prof"           (NoArg (addWay WayProf)) Supported
   , Flag "eventlog"       (NoArg (addWay WayEventLog)) Supported
-  , Flag "ticky"          (NoArg (addWay WayTicky)) Supported
   , Flag "parallel"       (NoArg (addWay WayPar)) Supported
   , Flag "gransim"        (NoArg (addWay WayGran)) Supported
   , Flag "smp"            (NoArg (addWay WayThreaded))
@@ -115,11 +114,15 @@ static_flags = [
   , Flag "debug"          (NoArg (addWay WayDebug)) Supported
   , Flag "ndp"            (NoArg (addWay WayNDP)) Supported
   , Flag "threaded"       (NoArg (addWay WayThreaded)) Supported
-        -- ToDo: user ways
+
+  , Flag "ticky"          (PassFlag (\f -> do addOpt f; addWay WayDebug)) Supported
+    -- -ticky enables ticky-ticky code generation, and also implies -debug which
+    -- is required to get the RTS ticky support.
 
         ------ Debugging ----------------------------------------------------
   , Flag "dppr-debug"        (PassFlag addOpt) Supported
   , Flag "dsuppress-uniques" (PassFlag addOpt) Supported
+  , Flag "dsuppress-coercions" (PassFlag addOpt) Supported
   , Flag "dppr-user-length"  (AnySuffix addOpt) Supported
   , Flag "dopt-fuel"         (AnySuffix addOpt) Supported
   , Flag "dno-debug-output"  (PassFlag addOpt) Supported
@@ -138,6 +141,11 @@ static_flags = [
   , Flag "Rghc-timing"    (NoArg  (enableTimingStats)) Supported
 
         ------ Compiler flags -----------------------------------------------
+
+        -- -fPIC requires extra checking: only the NCG supports it.
+        -- See also DynFlags.parseDynamicFlags.
+  , Flag "fPIC" (PassFlag setPIC) Supported
+
         -- All other "-fno-<blah>" options cancel out "-f<blah>" on the hsc cmdline
   , Flag "fno-"
          (PrefixPred (\s -> isStaticFlag ("f"++s)) (\s -> removeOpt ("-f"++s)))
@@ -147,6 +155,12 @@ static_flags = [
   , Flag "f" (AnySuffixPred isStaticFlag addOpt) Supported
   ]
 
+setPIC :: String -> IO ()
+setPIC | cGhcWithNativeCodeGen == "YES" || cGhcUnregisterised == "YES"
+       = addOpt
+       | otherwise
+       = ghcError $ CmdLineError "-fPIC is not supported on this platform"
+
 isStaticFlag :: String -> Bool
 isStaticFlag f =
   f `elem` [