X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=9e13360c1465fa197843f25b1539845252beadc6;hb=3e664735852117e5756472695b194055f5869510;hp=30489593f1e0a10526efb1a0fa41a8679a59f833;hpb=ab272eb88f58835d4ad6293813b88d2d6acc23c9;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 3048959..9e13360 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -12,9 +12,10 @@ module StaticFlags ( parseStaticFlags, staticFlags, + initStaticOpts, -- Ways - WayName(..), v_Ways, v_Build_tag, v_RTS_Build_tag, + WayName(..), v_Ways, v_Build_tag, v_RTS_Build_tag, isRTSWay, -- Output style options opt_PprUserLength, @@ -29,7 +30,6 @@ module StaticFlags ( -- Hpc opts opt_Hpc, - opt_Hpc_Tracer, -- language opts opt_DictsStrict, @@ -42,7 +42,6 @@ module StaticFlags ( opt_NoMethodSharing, opt_NoStateHack, opt_CprOff, - opt_RulesOff, opt_SimplNoPreInlining, opt_SimplExcessPrecision, opt_MaxWorkerArgs, @@ -93,6 +92,9 @@ import Data.List ( sort, intersperse, nub ) parseStaticFlags :: [String] -> IO [String] parseStaticFlags args = do + ready <- readIORef v_opt_C_ready + when ready $ throwDyn (ProgramError "Too late for parseStaticFlags: call it before newSession") + (leftover, errs) <- processArgs static_flags args when (not (null errs)) $ throwDyn (UsageError (unlines errs)) @@ -119,6 +121,8 @@ parseStaticFlags args = do when (not (null errs)) $ ghcError (UsageError (unlines errs)) return (cg_flags++more_leftover++leftover) +initStaticOpts :: IO () +initStaticOpts = writeIORef v_opt_C_ready True static_flags :: [(String, OptKind IO)] -- All the static flags should appear in this list. It describes how each @@ -156,11 +160,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") ) @@ -278,14 +277,10 @@ opt_AutoSccsOnAllToplevs = lookUp FSLIT("-fauto-sccs-on-all-toplevs") opt_AutoSccsOnExportedToplevs = lookUp FSLIT("-fauto-sccs-on-exported-toplevs") opt_AutoSccsOnIndividualCafs = lookUp FSLIT("-fauto-sccs-on-individual-cafs") opt_SccProfilingOn = lookUp FSLIT("-fscc-profiling") -opt_DoTickyProfiling = lookUp FSLIT("-fticky-ticky") - +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") @@ -297,7 +292,6 @@ opt_Flatten = lookUp FSLIT("-fflatten") opt_NoStateHack = lookUp FSLIT("-fno-state-hack") opt_NoMethodSharing = lookUp FSLIT("-fno-method-sharing") opt_CprOff = lookUp FSLIT("-fcpr-off") -opt_RulesOff = lookUp FSLIT("-frules-off") -- Switch off CPR analysis in the new demand analyser opt_MaxWorkerArgs = lookup_def_int "-fmax-worker-args" (10::Int) @@ -354,7 +348,6 @@ isStaticFlag f = "fauto-sccs-on-exported-toplevs", "fauto-sccs-on-individual-cafs", "fscc-profiling", - "fticky-ticky", "fdicts-strict", "firrefutable-tuples", "fparallel", @@ -371,10 +364,10 @@ isStaticFlag f = "static", "funregisterised", "fext-core", - "frules-off", "fcpr-off", "ferror-spans", - "fPIC" + "fPIC", + "fhpc" ] || any (flip prefixMatch f) [ "fliberate-case-threshold", @@ -517,6 +510,8 @@ lkupWay w = Nothing -> error "findBuildTag" Just details -> details +isRTSWay = wayRTSOnly . lkupWay + data Way = Way { wayTag :: String, wayRTSOnly :: Bool, @@ -548,8 +543,7 @@ way_details = , "-optc-DPROFILING" ]), (WayTicky, Way "t" True "Ticky-ticky Profiling" - [ "-fticky-ticky" - , "-DTICKY_TICKY" + [ "-DTICKY_TICKY" , "-optc-DTICKY_TICKY" ]), (WayUnreg, Way "u" False "Unregisterised"