X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=43f630ca55ab84a8703df7738b5305d55d052ce4;hb=dbc0cbaa7320387bdbac7b01b2782f60c4d33fd4;hp=06a47b5a653c3d393293a77c78f1e983df93f4fb;hpb=d061166982c65f8e61b4faf942bc5737da2b272c;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 06a47b5..43f630c 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + ----------------------------------------------------------------------------- -- -- Static flags @@ -30,7 +37,6 @@ module StaticFlags ( -- Hpc opts opt_Hpc, - opt_Hpc_Tracer, -- language opts opt_DictsStrict, @@ -58,10 +64,10 @@ module StaticFlags ( -- Related to linking opt_PIC, opt_Static, + opt_HardwireLibPaths, -- misc opts opt_IgnoreDotGhci, - opt_ShortGhciBanner, opt_ErrorSpans, opt_GranMacros, opt_HiVersion, @@ -87,7 +93,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 +126,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,12 +156,9 @@ 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) ) - , ( "unreg" , NoArg (addWay WayUnreg) ) , ( "ticky" , NoArg (addWay WayTicky) ) , ( "parallel" , NoArg (addWay WayPar) ) , ( "gransim" , NoArg (addWay WayGran) ) @@ -164,11 +173,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 +280,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 +293,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") @@ -335,6 +335,7 @@ opt_PIC = True opt_PIC = lookUp FSLIT("-fPIC") #endif opt_Static = lookUp FSLIT("-static") +opt_HardwireLibPaths = lookUp FSLIT("-fhardwire-lib-paths") opt_Unregisterised = lookUp FSLIT("-funregisterised") -- Derived, not a real option. Determines whether we will be compiling @@ -375,13 +376,15 @@ isStaticFlag f = "fexcess-precision", "funfolding-update-in-place", "static", + "fhardwire-lib-paths", "funregisterised", "fext-core", "fcpr-off", "ferror-spans", - "fPIC" + "fPIC", + "fhpc" ] - || any (flip prefixMatch f) [ + || any (`isPrefixOf` f) [ "fliberate-case-threshold", "fmax-worker-args", "fhistory-size", @@ -415,7 +418,7 @@ decodeSize str | c == "G" || c == "g" = truncate (n * 1000 * 1000 * 1000) | otherwise = throwDyn (CmdLineError ("can't decode size: " ++ str)) where (m, c) = span pred str - n = read m :: Double + n = readRational m pred c = isDigit c || c == '.' @@ -451,7 +454,6 @@ data WayName = WayThreaded | WayDebug | WayProf - | WayUnreg | WayTicky | WayPar | WayGran @@ -488,7 +490,6 @@ allowed_combination way = and [ x `allowedWith` y _ `allowedWith` WayDebug = True WayDebug `allowedWith` _ = True - WayProf `allowedWith` WayUnreg = True WayProf `allowedWith` WayNDP = True _ `allowedWith` _ = False @@ -558,9 +559,6 @@ way_details = [ "-DTICKY_TICKY" , "-optc-DTICKY_TICKY" ]), - (WayUnreg, Way "u" False "Unregisterised" - unregFlags ), - -- optl's below to tell linker where to find the PVM library -- HWL (WayPar, Way "mp" False "Parallel" [ "-fparallel"