Adding pushing of hpc translation status through hi files.
[ghc-hetmet.git] / compiler / main / StaticFlags.hs
index 06a47b5..e71c5c7 100644 (file)
@@ -30,7 +30,6 @@ module StaticFlags (
 
         -- Hpc opts
        opt_Hpc,
-        opt_Hpc_Tracer,
 
        -- language opts
        opt_DictsStrict,
@@ -61,7 +60,6 @@ module StaticFlags (
 
        -- misc opts
        opt_IgnoreDotGhci,
-       opt_ShortGhciBanner,
        opt_ErrorSpans,
        opt_GranMacros,
        opt_HiVersion,
@@ -87,7 +85,7 @@ import Data.IORef
 import System.IO.Unsafe        ( unsafePerformIO )
 import Control.Monad   ( when )
 import Data.Char       ( isDigit )
-import Data.List       ( sort, intersperse, nub )
+import Data.List
 
 -----------------------------------------------------------------------------
 -- Static flags
@@ -120,8 +118,14 @@ parseStaticFlags args = do
   let cg_flags | tablesNextToCode = ["-optc-DTABLES_NEXT_TO_CODE"]
               | otherwise        = []
 
+    -- HACK: -fexcess-precision is both a static and a dynamic flag.  If
+    -- the static flag parser has slurped it, we must return it as a 
+    -- leftover too.  ToDo: make -fexcess-precision dynamic only.
+  let excess_prec | opt_SimplExcessPrecision = ["-fexcess-precision"]
+                  | otherwise                = []
+
   when (not (null errs)) $ ghcError (UsageError (unlines errs))
-  return (cg_flags++more_leftover++leftover)
+  return (excess_prec++cg_flags++more_leftover++leftover)
 
 initStaticOpts :: IO ()
 initStaticOpts = writeIORef v_opt_C_ready True
@@ -144,8 +148,6 @@ static_flags = [
        ------- GHCi -------------------------------------------------------
      ( "ignore-dot-ghci", PassFlag addOpt )
   ,  ( "read-dot-ghci"  , NoArg (removeOpt "-ignore-dot-ghci") )
-  ,  ( "short-ghci-banner", PassFlag addOpt )
-  ,  ( "long-ghci-banner" , NoArg (removeOpt "-short-ghci-banner") )
 
        ------- ways --------------------------------------------------------
   ,  ( "prof"          , NoArg (addWay WayProf) )
@@ -164,11 +166,6 @@ static_flags = [
   ,  ( "dppr-user-length", AnySuffix addOpt )
       -- rest of the debugging flags are dynamic
 
-       --------- Haskell Program Coverage -----------------------------------
-
-  ,  ( "fhpc"           , PassFlag addOpt )
-  ,  ( "fhpc-tracer"    , PassFlag addOpt )
-
        --------- Profiling --------------------------------------------------
   ,  ( "auto-all"      , NoArg (addOpt "-fauto-sccs-on-all-toplevs") )
   ,  ( "auto"          , NoArg (addOpt "-fauto-sccs-on-exported-toplevs") )
@@ -276,7 +273,6 @@ unpacked_opts =
 
 
 opt_IgnoreDotGhci              = lookUp FSLIT("-ignore-dot-ghci")
-opt_ShortGhciBanner             = lookUp FSLIT("-short-ghci-banner")
 
 -- debugging opts
 opt_PprStyle_Debug             = lookUp  FSLIT("-dppr-debug")
@@ -290,10 +286,7 @@ opt_SccProfilingOn         = lookUp  FSLIT("-fscc-profiling")
 opt_DoTickyProfiling            = WayTicky `elem` (unsafePerformIO $ readIORef v_Ways)
 
 -- Hpc opts
-
 opt_Hpc                                = lookUp FSLIT("-fhpc")  
-                                 || opt_Hpc_Tracer 
-opt_Hpc_Tracer                 = lookUp FSLIT("-fhpc-tracer")
 
 -- language opts
 opt_DictsStrict                        = lookUp  FSLIT("-fdicts-strict")
@@ -379,9 +372,10 @@ isStaticFlag f =
        "fext-core",
        "fcpr-off",
        "ferror-spans",
-       "fPIC"
+       "fPIC",
+       "fhpc"
        ]
-  || any (flip prefixMatch f) [
+  || any (`isPrefixOf` f) [
        "fliberate-case-threshold",
        "fmax-worker-args",
        "fhistory-size",