X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=67e8ab58e50c7883c90d045b4ad7fa85158d82b6;hb=d2b7119250068ecbf5f085220663687733bde477;hp=30489593f1e0a10526efb1a0fa41a8679a59f833;hpb=ab272eb88f58835d4ad6293813b88d2d6acc23c9;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 3048959..67e8ab5 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 @@ -278,14 +282,14 @@ 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") - - --- Hpc opts +opt_DoTickyProfiling = WayTicky `elem` (unsafePerformIO $ readIORef v_Ways) +-- Hpc opts, only work in a stage2 build +#if GHCI opt_Hpc = lookUp FSLIT("-fhpc") - || opt_Hpc_Tracer -opt_Hpc_Tracer = lookUp FSLIT("-fhpc-tracer") +#else +opt_Hpc = False +#endif -- language opts opt_DictsStrict = lookUp FSLIT("-fdicts-strict") @@ -297,7 +301,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 +357,6 @@ isStaticFlag f = "fauto-sccs-on-exported-toplevs", "fauto-sccs-on-individual-cafs", "fscc-profiling", - "fticky-ticky", "fdicts-strict", "firrefutable-tuples", "fparallel", @@ -371,7 +373,6 @@ isStaticFlag f = "static", "funregisterised", "fext-core", - "frules-off", "fcpr-off", "ferror-spans", "fPIC" @@ -517,6 +518,8 @@ lkupWay w = Nothing -> error "findBuildTag" Just details -> details +isRTSWay = wayRTSOnly . lkupWay + data Way = Way { wayTag :: String, wayRTSOnly :: Bool, @@ -548,8 +551,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"