X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=e71c5c7f985a99d5d32d4c2640a30b70b5e1976c;hb=c1681a73fa4ca4cf8758264ae387ac09a9e900d8;hp=457626c80ced87da5f4a93140eb2de7dbbcf9578;hpb=bda0a4f655b2f9892d2778b0ab1b5d437c392226;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 457626c..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,10 +166,6 @@ static_flags = [ , ( "dppr-user-length", AnySuffix addOpt ) -- rest of the debugging flags are dynamic - --------- Haskell Program Coverage ----------------------------------- - - , ( "fhpc" , PassFlag addOpt ) - --------- Profiling -------------------------------------------------- , ( "auto-all" , NoArg (addOpt "-fauto-sccs-on-all-toplevs") ) , ( "auto" , NoArg (addOpt "-fauto-sccs-on-exported-toplevs") ) @@ -370,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",