X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=e71c5c7f985a99d5d32d4c2640a30b70b5e1976c;hb=c1681a73fa4ca4cf8758264ae387ac09a9e900d8;hp=546565c966b5dcfd34c1fc5014b35d0153871f12;hpb=6646a0226e5380a3ff088cfc59fb761d8265994b;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 546565c..e71c5c7 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -85,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 @@ -118,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 @@ -160,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") ) @@ -371,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",