Commit cd33eefd authored by ian@well-typed.com's avatar ian@well-typed.com

Some alpha renaming

Mostly d -> g (matching DynFlag -> GeneralFlag).
Also renamed if* to when*, matching the Haskell if/when names
parent 6759e5a4
......@@ -466,7 +466,7 @@ pprExternal sty uniq mod occ name is_wired is_builtin
| otherwise = pprModulePrefix sty mod name <> ppr_occ_name occ
where
pp_mod = sdocWithDynFlags $ \dflags ->
if dopt Opt_SuppressModulePrefixes dflags
if gopt Opt_SuppressModulePrefixes dflags
then empty
else ppr mod <> dot
......@@ -496,7 +496,7 @@ pprModulePrefix :: PprStyle -> Module -> Name -> SDoc
-- Print the "M." part of a name, based on whether it's in scope or not
-- See Note [Printing original names] in HscTypes
pprModulePrefix sty mod name = sdocWithDynFlags $ \dflags ->
if dopt Opt_SuppressModulePrefixes dflags
if gopt Opt_SuppressModulePrefixes dflags
then empty
else
case qualName sty name of -- See Outputable.QualifyName:
......@@ -511,7 +511,7 @@ ppr_underscore_unique :: Unique -> SDoc
-- But suppress it if we aren't printing the uniques anyway
ppr_underscore_unique uniq
= sdocWithDynFlags $ \dflags ->
if dopt Opt_SuppressUniques dflags
if gopt Opt_SuppressUniques dflags
then empty
else char '_' <> pprUnique uniq
......
......@@ -272,7 +272,7 @@ pprOccName (OccName sp occ)
| otherwise = empty
pp_occ = sdocWithDynFlags $ \dflags ->
if dopt Opt_SuppressUniques dflags
if gopt Opt_SuppressUniques dflags
then text (strip_th_unique (unpackFS occ))
else ftext occ
......
......@@ -215,7 +215,7 @@ After CoreTidy, top-level LocalIds are turned into GlobalIds
instance Outputable Var where
ppr var = ppr (varName var) <+> ifPprDebug (brackets (ppr_debug var))
-- Printing the type on every occurrence is too much!
-- <+> if (not (dopt Opt_SuppressVarKinds dflags))
-- <+> if (not (gopt Opt_SuppressVarKinds dflags))
-- then ifPprDebug (text "::" <+> ppr (tyVarKind var) <+> text ")")
-- else empty
......
......@@ -819,7 +819,7 @@ labelDynamic :: DynFlags -> PackageId -> CLabel -> Bool
labelDynamic dflags this_pkg lbl =
case lbl of
-- is the RTS in a DLL or not?
RtsLabel _ -> not (dopt Opt_Static dflags) && (this_pkg /= rtsPackageId)
RtsLabel _ -> not (gopt Opt_Static dflags) && (this_pkg /= rtsPackageId)
IdLabel n _ _ -> isDllName dflags this_pkg n
......@@ -827,7 +827,7 @@ labelDynamic dflags this_pkg lbl =
-- its own shared library.
CmmLabel pkg _ _
| os == OSMinGW32 ->
not (dopt Opt_Static dflags) && (this_pkg /= pkg)
not (gopt Opt_Static dflags) && (this_pkg /= pkg)
| otherwise ->
True
......@@ -845,14 +845,14 @@ labelDynamic dflags this_pkg lbl =
-- When compiling in the "dyn" way, each package is to be
-- linked into its own DLL.
ForeignLabelInPackage pkgId ->
(not (dopt Opt_Static dflags)) && (this_pkg /= pkgId)
(not (gopt Opt_Static dflags)) && (this_pkg /= pkgId)
else -- On Mac OS X and on ELF platforms, false positives are OK,
-- so we claim that all foreign imports come from dynamic
-- libraries
True
PlainModuleInitLabel m -> not (dopt Opt_Static dflags) && this_pkg /= (modulePackageId m)
PlainModuleInitLabel m -> not (gopt Opt_Static dflags) && this_pkg /= (modulePackageId m)
-- Note that DynamicLinkerLabels do NOT require dynamic linking themselves.
_ -> False
......
......@@ -366,7 +366,7 @@ mkStdInfoTable dflags (type_descr, closure_descr) cl_type srt_len layout_lit
where
prof_info
| dopt Opt_SccProfilingOn dflags = [type_descr, closure_descr]
| gopt Opt_SccProfilingOn dflags = [type_descr, closure_descr]
| otherwise = []
type_lit = packHalfWordsCLit dflags (toStgHalfWord dflags (fromIntegral cl_type)) srt_len
......
......@@ -1018,7 +1018,7 @@ pushStackFrame fields body = do
withUpdFrameOff new_updfr_off body
profilingInfo dflags desc_str ty_str
= if not (dopt Opt_SccProfilingOn dflags)
= if not (gopt Opt_SccProfilingOn dflags)
then NoProfilingInfo
else ProfilingInfo (stringToWord8s desc_str)
(stringToWord8s ty_str)
......
......@@ -85,7 +85,7 @@ cpsTop hsc_env proc =
return call_pps
let noncall_pps = proc_points `setDifference` call_pps
when (not (setNull noncall_pps) && dopt Opt_D_dump_cmmz dflags) $
when (not (setNull noncall_pps) && gopt Opt_D_dump_cmmz dflags) $
pprTrace "Non-call proc points: " (ppr noncall_pps) $ return ()
----------- Sink and inline assignments *before* stack layout -----------
......@@ -163,7 +163,7 @@ cpsTop hsc_env proc =
= mapM_ (dumpWith dflags flag name)
condPass flag pass g dumpflag dumpname =
if dopt flag dflags
if gopt flag dflags
then do
g <- return $ pass g
dump dumpflag dumpname g
......@@ -186,7 +186,7 @@ runUniqSM m = do
dumpGraph :: DynFlags -> GeneralFlag -> String -> CmmGraph -> IO ()
dumpGraph dflags flag name g = do
when (dopt Opt_DoCmmLinting dflags) $ do_lint g
when (gopt Opt_DoCmmLinting dflags) $ do_lint g
dumpWith dflags flag name g
where
do_lint g = case cmmLintGraph dflags g of
......@@ -201,6 +201,6 @@ dumpWith dflags flag txt g = do
-- them into files." Also, -ddump-cmmz doesn't play nicely
-- with -ddump-to-file, since the headers get omitted.
dumpIfSet_dyn dflags flag txt (ppr g)
when (not (dopt flag dflags)) $
when (not (gopt flag dflags)) $
dumpIfSet_dyn dflags Opt_D_dump_cmmz txt (ppr g)
......@@ -61,7 +61,7 @@ pprCs dflags cmms
= pprCode CStyle (vcat $ map (\c -> split_marker $$ pprC c) cmms)
where
split_marker
| dopt Opt_SplitObjs dflags = ptext (sLit "__STG_SPLIT_MARKER")
| gopt Opt_SplitObjs dflags = ptext (sLit "__STG_SPLIT_MARKER")
| otherwise = empty
writeCs :: DynFlags -> Handle -> [RawCmmGroup] -> IO ()
......
......@@ -267,7 +267,7 @@ fixedHdrSize dflags = sTD_HDR_SIZE dflags + profHdrSize dflags
-- (StgProfHeader in includes/rts/storage/Closures.h)
profHdrSize :: DynFlags -> WordOff
profHdrSize dflags
| dopt Opt_SccProfilingOn dflags = pROF_HDR_SIZE dflags
| gopt Opt_SccProfilingOn dflags = pROF_HDR_SIZE dflags
| otherwise = 0
-- | The garbage collector requires that every closure is at least as
......
......@@ -164,7 +164,7 @@ constructSlowCall amodes
slowArgs :: DynFlags -> [(CgRep,CmmExpr)] -> [(CgRep,CmmExpr)]
slowArgs _ [] = []
slowArgs dflags amodes
| dopt Opt_SccProfilingOn dflags = save_cccs ++ this_pat ++ slowArgs dflags rest
| gopt Opt_SccProfilingOn dflags = save_cccs ++ this_pat ++ slowArgs dflags rest
| otherwise = this_pat ++ slowArgs dflags rest
where
(arg_pat, args, rest) = matchSlowPattern amodes
......
......@@ -653,7 +653,7 @@ saveCurrentCostCentre ::
saveCurrentCostCentre
= do dflags <- getDynFlags
if not (dopt Opt_SccProfilingOn dflags)
if not (gopt Opt_SccProfilingOn dflags)
then returnFC (Nothing, noStmts)
else do slot <- allocPrimStack PtrArg
sp_rel <- getSpRelOffset slot
......
......@@ -482,8 +482,8 @@ emitBlackHoleCode is_single_entry = do
-- Note the eager-blackholing check is here rather than in blackHoleOnEntry,
-- because emitBlackHoleCode is called from CmmParse.
let eager_blackholing = not (dopt Opt_SccProfilingOn dflags)
&& dopt Opt_EagerBlackHoling dflags
let eager_blackholing = not (gopt Opt_SccProfilingOn dflags)
&& gopt Opt_EagerBlackHoling dflags
-- Profiling needs slop filling (to support LDV
-- profiling), so currently eager blackholing doesn't
-- work with profiling.
......@@ -515,8 +515,8 @@ setupUpdate closure_info code
tickyPushUpdateFrame
dflags <- getDynFlags
if blackHoleOnEntry closure_info &&
not (dopt Opt_SccProfilingOn dflags) &&
dopt Opt_EagerBlackHoling dflags
not (gopt Opt_SccProfilingOn dflags) &&
gopt Opt_EagerBlackHoling dflags
then pushBHUpdateFrame (CmmReg nodeReg) code
else pushUpdateFrame (CmmReg nodeReg) code
......
......@@ -185,7 +185,7 @@ because they don't support cross package data references well.
buildDynCon' dflags platform binder _ con [arg_amode]
| maybeIntLikeCon con
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, platformOS platform /= OSMinGW32 || not (gopt Opt_PIC dflags)
, (_, CmmLit (CmmInt val _)) <- arg_amode
, let val_int = (fromIntegral val) :: Int
, val_int <= mAX_INTLIKE dflags && val_int >= mIN_INTLIKE dflags
......@@ -197,7 +197,7 @@ buildDynCon' dflags platform binder _ con [arg_amode]
buildDynCon' dflags platform binder _ con [arg_amode]
| maybeCharLikeCon con
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, platformOS platform /= OSMinGW32 || not (gopt Opt_PIC dflags)
, (_, CmmLit (CmmInt val _)) <- arg_amode
, let val_int = (fromIntegral val) :: Int
, val_int <= mAX_CHARLIKE dflags && val_int >= mIN_CHARLIKE dflags
......@@ -324,7 +324,7 @@ cgReturnDataCon con amodes = do
if isUnboxedTupleCon con then returnUnboxedTuple amodes
-- when profiling we can't shortcut here, we have to enter the closure
-- for it to be marked as "used" for LDV profiling.
else if dopt Opt_SccProfilingOn dflags then build_it_then (enter_it dflags)
else if gopt Opt_SccProfilingOn dflags then build_it_then (enter_it dflags)
else ASSERT( amodes `lengthIs` dataConRepRepArity con )
do { EndOfBlockInfo _ sequel <- getEndOfBlockInfo
; case sequel of
......
......@@ -396,7 +396,7 @@ mkRhsClosure dflags bndr cc bi
&& all isFollowableArg (map idCgRep fvs)
&& isUpdatable upd_flag
&& arity <= mAX_SPEC_AP_SIZE dflags
&& not (dopt Opt_SccProfilingOn dflags)
&& not (gopt Opt_SccProfilingOn dflags)
-- not when profiling: we don't want to
-- lose information about this particular
-- thunk (e.g. its type) (#949)
......
......@@ -215,7 +215,7 @@ emitSaveThreadState = do
(stack_SP dflags)) stgSp
emitCloseNursery
-- and save the current cost centre stack in the TSO when profiling:
when (dopt Opt_SccProfilingOn dflags) $
when (gopt Opt_SccProfilingOn dflags) $
stmtC (CmmStore (cmmOffset dflags stgCurrentTSO (tso_CCCS dflags)) curCCS)
-- CurrentNursery->free = Hp+1;
......@@ -246,7 +246,7 @@ emitLoadThreadState = do
]
emitOpenNursery
-- and load the current cost centre stack from the TSO when profiling:
when (dopt Opt_SccProfilingOn dflags) $
when (gopt Opt_SccProfilingOn dflags) $
stmtC $ storeCurCCS $
CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_CCCS dflags)) (bWord dflags)
......
......@@ -74,7 +74,7 @@ mkCmmInfo cl_info
cit_prof = prof dflags,
cit_srt = closureSRT cl_info })
where
prof dflags | not (dopt Opt_SccProfilingOn dflags) = NoProfilingInfo
prof dflags | not (gopt Opt_SccProfilingOn dflags) = NoProfilingInfo
| otherwise = ProfilingInfo ty_descr_w8 val_descr_w8
ty_descr_w8 = stringToWord8s (closureTypeDescr cl_info)
val_descr_w8 = stringToWord8s (closureValDescr cl_info)
......@@ -254,7 +254,7 @@ stdInfoTableSizeW dflags
= size_fixed + size_prof
where
size_fixed = 2 -- layout, type
size_prof | dopt Opt_SccProfilingOn dflags = 2
size_prof | gopt Opt_SccProfilingOn dflags = 2
| otherwise = 0
stdInfoTableSizeB :: DynFlags -> ByteOff
......
......@@ -40,7 +40,7 @@ doGranAllocate :: CmmExpr -> Code
-- macro DO_GRAN_ALLOCATE
doGranAllocate _hp
= do dflags <- getDynFlags
when (dopt Opt_GranMacros dflags) $ panic "doGranAllocate"
when (gopt Opt_GranMacros dflags) $ panic "doGranAllocate"
......@@ -52,7 +52,7 @@ granFetchAndReschedule :: [(Id,GlobalReg)] -- Live registers
granFetchAndReschedule regs node_reqd
= do dflags <- getDynFlags
let liveness = mkRegLiveness dflags regs 0 0
when (dopt Opt_GranMacros dflags &&
when (gopt Opt_GranMacros dflags &&
(node `elem` map snd regs || node_reqd)) $
do fetch
reschedule liveness node_reqd
......@@ -90,7 +90,7 @@ granYield :: [(Id,GlobalReg)] -- Live registers
granYield regs node_reqd
= do dflags <- getDynFlags
let liveness = mkRegLiveness dflags regs 0 0
when (dopt Opt_GranMacros dflags && node_reqd) $ yield liveness
when (gopt Opt_GranMacros dflags && node_reqd) $ yield liveness
yield :: StgWord -> Code
yield _liveness = panic "granYield"
......
......@@ -159,7 +159,7 @@ emitPrimOp dflags [res] GetCCSOfOp [arg] _live
= stmtC (CmmAssign (CmmLocal res) val)
where
val
| dopt Opt_SccProfilingOn dflags = costCentreFrom dflags (cmmUntag dflags arg)
| gopt Opt_SccProfilingOn dflags = costCentreFrom dflags (cmmUntag dflags arg)
| otherwise = CmmLit (zeroCLit dflags)
emitPrimOp _ [res] GetCurrentCCSOp [_dummy_arg] _live
......
......@@ -139,11 +139,11 @@ enterCostCentreFun ccs closure vols =
ifProfiling :: Code -> Code
ifProfiling code
= do dflags <- getDynFlags
if dopt Opt_SccProfilingOn dflags then code else nopC
if gopt Opt_SccProfilingOn dflags then code else nopC
ifProfilingL :: DynFlags -> [a] -> [a]
ifProfilingL dflags xs
| dopt Opt_SccProfilingOn dflags = xs
| gopt Opt_SccProfilingOn dflags = xs
| otherwise = []
-- ---------------------------------------------------------------------------
......@@ -220,7 +220,7 @@ sizeof_ccs_words dflags
emitSetCCC :: CostCentre -> Bool -> Bool -> Code
emitSetCCC cc tick push
= do dflags <- getDynFlags
if dopt Opt_SccProfilingOn dflags
if gopt Opt_SccProfilingOn dflags
then do tmp <- newTemp (bWord dflags) -- TODO FIXME NOW
pushCostCentre tmp curCCS cc
when tick $ stmtC (bumpSccCount dflags (CmmReg (CmmLocal tmp)))
......
......@@ -197,7 +197,7 @@ performTailCall fun_info arg_amodes pending_assts
-- Test if closure is a constructor
maybeSwitchOnCons dflags enterClosure eob
| EndOfBlockInfo _ (CaseAlts lbl _ _) <- eob,
not (dopt Opt_SccProfilingOn dflags)
not (gopt Opt_SccProfilingOn dflags)
-- we can't shortcut when profiling is on, because we have
-- to enter a closure to mark it as "used" for LDV profiling
= do { is_constr <- newLabelC
......
......@@ -308,7 +308,7 @@ tickyAllocHeap hp
ifTicky :: Code -> Code
ifTicky code = do dflags <- getDynFlags
if dopt Opt_Ticky dflags then code
if gopt Opt_Ticky dflags then code
else nopC
addToMemLbl :: Width -> CLabel -> Int -> CmmStmt
......
......@@ -579,7 +579,7 @@ nodeMustPointToIt _ (LFCon _) = True
-- 27/11/92.
nodeMustPointToIt dflags (LFThunk _ no_fvs updatable NonStandardThunk _)
= updatable || not no_fvs || dopt Opt_SccProfilingOn dflags
= updatable || not no_fvs || gopt Opt_SccProfilingOn dflags
-- For the non-updatable (single-entry case):
--
-- True if has fvs (in which case we need access to them, and we
......@@ -651,7 +651,7 @@ getCallMethod :: DynFlags
-> CallMethod
getCallMethod dflags _ _ lf_info _
| nodeMustPointToIt dflags lf_info && dopt Opt_Parallel dflags
| nodeMustPointToIt dflags lf_info && gopt Opt_Parallel dflags
= -- If we're parallel, then we must always enter via node.
-- The reason is that the closure may have been
-- fetched since we allocated it.
......@@ -666,7 +666,7 @@ getCallMethod dflags name caf (LFReEntrant _ arity _ _) n_args
getCallMethod dflags _ _ (LFCon con) n_args
-- when profiling, we must always enter a closure when we use it, so
-- that the closure can be recorded as used for LDV profiling.
| dopt Opt_SccProfilingOn dflags
| gopt Opt_SccProfilingOn dflags
= EnterIt
| otherwise
= ASSERT( n_args == 0 )
......@@ -689,7 +689,7 @@ getCallMethod _dflags _name _caf (LFThunk _ _ _updatable _std_form_info is_fun)
-- So the right thing to do is just to enter the thing
-- Old version:
-- | updatable || dopt Opt_Ticky dflags -- to catch double entry
-- | updatable || gopt Opt_Ticky dflags -- to catch double entry
-- = EnterIt
-- | otherwise -- Jump direct to code for single-entry thunks
-- = JumpToIt (thunkEntryLabel name caf std_form_info updatable)
......
......@@ -262,7 +262,7 @@ cgDataCon data_con
maybeExternaliseId :: DynFlags -> Id -> FCode Id
maybeExternaliseId dflags id
| dopt Opt_SplitObjs dflags, -- Externalise the name for -split-objs
| gopt Opt_SplitObjs dflags, -- Externalise the name for -split-objs
isInternalName name = do { mod <- getModuleName
; returnFC (setIdName id (externalise mod)) }
| otherwise = returnFC id
......
......@@ -273,7 +273,7 @@ mkRhsClosure dflags bndr _cc _bi
&& all (isGcPtrRep . idPrimRep . stripNV) fvs
&& isUpdatable upd_flag
&& arity <= mAX_SPEC_AP_SIZE dflags
&& not (dopt Opt_SccProfilingOn dflags)
&& not (gopt Opt_SccProfilingOn dflags)
-- not when profiling: we don't want to
-- lose information about this particular
-- thunk (e.g. its type) (#949)
......@@ -574,8 +574,8 @@ emitBlackHoleCode is_single_entry node = do
-- Note the eager-blackholing check is here rather than in blackHoleOnEntry,
-- because emitBlackHoleCode is called from CmmParse.
let eager_blackholing = not (dopt Opt_SccProfilingOn dflags)
&& dopt Opt_EagerBlackHoling dflags
let eager_blackholing = not (gopt Opt_SccProfilingOn dflags)
&& gopt Opt_EagerBlackHoling dflags
-- Profiling needs slop filling (to support LDV
-- profiling), so currently eager blackholing doesn't
-- work with profiling.
......@@ -603,8 +603,8 @@ setupUpdate closure_info node body
dflags <- getDynFlags
let
bh = blackHoleOnEntry closure_info &&
not (dopt Opt_SccProfilingOn dflags) &&
dopt Opt_EagerBlackHoling dflags
not (gopt Opt_SccProfilingOn dflags) &&
gopt Opt_EagerBlackHoling dflags
lbl | bh = mkBHUpdInfoLabel
| otherwise = mkUpdInfoLabel
......
......@@ -400,7 +400,7 @@ nodeMustPointToIt _ (LFCon _) = True
-- 27/11/92.
nodeMustPointToIt dflags (LFThunk _ no_fvs updatable NonStandardThunk _)
= updatable || not no_fvs || dopt Opt_SccProfilingOn dflags
= updatable || not no_fvs || gopt Opt_SccProfilingOn dflags
-- For the non-updatable (single-entry case):
--
-- True if has fvs (in which case we need access to them, and we
......@@ -472,7 +472,7 @@ getCallMethod :: DynFlags
-> CallMethod
getCallMethod dflags _name _ lf_info _n_args
| nodeMustPointToIt dflags lf_info && dopt Opt_Parallel dflags
| nodeMustPointToIt dflags lf_info && gopt Opt_Parallel dflags
= -- If we're parallel, then we must always enter via node.
-- The reason is that the closure may have been
-- fetched since we allocated it.
......@@ -496,7 +496,7 @@ getCallMethod dflags name caf (LFThunk _ _ updatable std_form_info is_fun) n_arg
-- is the fast-entry code]
-- Since is_fun is False, we are *definitely* looking at a data value
| updatable || dopt Opt_Ticky dflags -- to catch double entry
| updatable || gopt Opt_Ticky dflags -- to catch double entry
{- OLD: || opt_SMP
I decided to remove this, because in SMP mode it doesn't matter
if we enter the same thunk multiple times, so the optimisation
......@@ -852,7 +852,7 @@ enterIdLabel dflags id c
mkProfilingInfo :: DynFlags -> Id -> String -> ProfilingInfo
mkProfilingInfo dflags id val_descr
| not (dopt Opt_SccProfilingOn dflags) = NoProfilingInfo
| not (gopt Opt_SccProfilingOn dflags) = NoProfilingInfo
| otherwise = ProfilingInfo ty_descr_w8 val_descr_w8
where
ty_descr_w8 = stringToWord8s (getTyDescription (idType id))
......@@ -899,7 +899,7 @@ mkDataConInfoTable dflags data_con is_static ptr_wds nonptr_wds
cl_type = Constr (dataConTagZ data_con) (dataConIdentity data_con)
prof | not (dopt Opt_SccProfilingOn dflags) = NoProfilingInfo
prof | not (gopt Opt_SccProfilingOn dflags) = NoProfilingInfo
| otherwise = ProfilingInfo ty_descr val_descr
ty_descr = stringToWord8s $ occNameString $ getOccName $ dataConTyCon data_con
......
......@@ -181,7 +181,7 @@ because they don't support cross package data references well.
buildDynCon' dflags platform binder _cc con [arg]
| maybeIntLikeCon con
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, platformOS platform /= OSMinGW32 || not (gopt Opt_PIC dflags)
, StgLitArg (MachInt val) <- arg
, val <= fromIntegral (mAX_INTLIKE dflags) -- Comparisons at type Integer!
, val >= fromIntegral (mIN_INTLIKE dflags) -- ...ditto...
......@@ -195,7 +195,7 @@ buildDynCon' dflags platform binder _cc con [arg]
buildDynCon' dflags platform binder _cc con [arg]
| maybeCharLikeCon con
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, platformOS platform /= OSMinGW32 || not (gopt Opt_PIC dflags)
, StgLitArg (MachChar val) <- arg
, let val_int = ord val :: Int
, val_int <= mAX_CHARLIKE dflags
......
......@@ -276,7 +276,7 @@ saveThreadState dflags =
mkStore (cmmOffset dflags (CmmLoad (cmmOffset dflags stgCurrentTSO (tso_stackobj dflags)) (bWord dflags)) (stack_SP dflags)) stgSp
<*> closeNursery dflags
-- and save the current cost centre stack in the TSO when profiling:
<*> if dopt Opt_SccProfilingOn dflags then
<*> if gopt Opt_SccProfilingOn dflags then
mkStore (cmmOffset dflags stgCurrentTSO (tso_CCCS dflags)) curCCS
else mkNop
......@@ -308,7 +308,7 @@ loadThreadState dflags tso stack = do
(rESERVED_STACK_WORDS dflags)),
openNursery dflags,
-- and load the current cost centre stack from the TSO when profiling:
if dopt Opt_SccProfilingOn dflags then
if gopt Opt_SccProfilingOn dflags then
storeCurCCS
(CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_CCCS dflags)) (ccsType dflags))
else mkNop]
......
......@@ -584,7 +584,7 @@ do_checks mb_stk_hwm checkYield mb_alloc_lit do_gc = do
emitAssign hpReg bump_hp
emit =<< mkCmmIfThen hp_oflo (alloc_n <*> mkBranch gc_id)
else do
when (not (dopt Opt_OmitYields dflags) && checkYield) $ do
when (not (gopt Opt_OmitYields dflags) && checkYield) $ do
-- Yielding if HpLim == 0
let yielding = CmmMachOp (mo_wordEq dflags)
[CmmReg (CmmGlobal HpLim),
......
......@@ -38,7 +38,7 @@ initHpc _ (NoHpcInfo {})
= return ()
initHpc this_mod (HpcInfo tickCount _hashNo)
= do dflags <- getDynFlags
when (dopt Opt_Hpc dflags) $
when (gopt Opt_Hpc dflags) $
do emitDataLits (mkHpcTicksLabel this_mod)
[ (CmmInt 0 W64)
| _ <- take tickCount [0 :: Int ..]
......
......@@ -291,7 +291,7 @@ just more arguments that we are passing on the stack (cml_args).
slowArgs :: DynFlags -> [(ArgRep, Maybe CmmExpr)] -> [(ArgRep, Maybe CmmExpr)]
slowArgs _ [] = []
slowArgs dflags args -- careful: reps contains voids (V), but args does not
| dopt Opt_SccProfilingOn dflags
| gopt Opt_SccProfilingOn dflags
= save_cccs ++ this_pat ++ slowArgs dflags rest_args
| otherwise = this_pat ++ slowArgs dflags rest_args
where
......@@ -547,7 +547,7 @@ stdInfoTableSizeW dflags
= size_fixed + size_prof
where
size_fixed = 2 -- layout, type
size_prof | dopt Opt_SccProfilingOn dflags = 2
size_prof | gopt Opt_SccProfilingOn dflags = 2
| otherwise = 0
stdInfoTableSizeB :: DynFlags -> ByteOff
......
......@@ -240,7 +240,7 @@ emitPrimOp dflags [res] GetCCSOfOp [arg]
= emitAssign (CmmLocal res) val
where
val
| dopt Opt_SccProfilingOn dflags = costCentreFrom dflags (cmmUntag dflags arg)
| gopt Opt_SccProfilingOn dflags = costCentreFrom dflags (cmmUntag dflags arg)
| otherwise = CmmLit (zeroCLit dflags)
emitPrimOp _ [res] GetCurrentCCSOp [_dummy_arg]
......
......@@ -133,7 +133,7 @@ saveCurrentCostCentre :: FCode (Maybe LocalReg)
-- Returns Nothing if profiling is off
saveCurrentCostCentre
= do dflags <- getDynFlags
if not (dopt Opt_SccProfilingOn dflags)
if not (gopt Opt_SccProfilingOn dflags)
then return Nothing
else do local_cc <- newTemp (ccType dflags)
emitAssign (CmmLocal local_cc) curCCS
......@@ -196,13 +196,13 @@ enterCostCentreFun ccs closure =
ifProfiling :: FCode () -> FCode ()
ifProfiling code
= do dflags <- getDynFlags
if dopt Opt_SccProfilingOn dflags
if gopt Opt_SccProfilingOn dflags
then code
else return ()
ifProfilingL :: DynFlags -> [a] -> [a]
ifProfilingL dflags xs
| dopt Opt_SccProfilingOn dflags = xs
| gopt Opt_SccProfilingOn dflags = xs
| otherwise = []
......@@ -214,7 +214,7 @@ initCostCentres :: CollectedCCs -> FCode ()
-- Emit the declarations
initCostCentres (local_CCs, ___extern_CCs, singleton_CCSs)
= do dflags <- getDynFlags
when (dopt Opt_SccProfilingOn dflags) $
when (gopt Opt_SccProfilingOn dflags) $
do mapM_ emitCostCentreDecl local_CCs
mapM_ emitCostCentreStackDecl singleton_CCSs
......@@ -280,7 +280,7 @@ sizeof_ccs_words dflags
emitSetCCC :: CostCentre -> Bool -> Bool -> FCode ()
emitSetCCC cc tick push
= do dflags <- getDynFlags
if not (dopt Opt_SccProfilingOn dflags)
if not (gopt Opt_SccProfilingOn dflags)
then return ()
else do tmp <- newTemp (ccsType dflags) -- TODO FIXME NOW
pushCostCentre tmp curCCS cc
......
......@@ -332,7 +332,7 @@ tickyAllocHeap hp
ifTicky :: FCode () -> FCode ()
ifTicky code = do dflags <- getDynFlags
if dopt Opt_Ticky dflags then code
if gopt Opt_Ticky dflags then code
else return ()
-- All the ticky-ticky counters are declared "unsigned long" in C
......
......@@ -34,7 +34,7 @@ import TyCon ( isRecursiveTyCon, isClassTyCon )
import Coercion
import BasicTypes
import Unique
import DynFlags ( DynFlags, GeneralFlag(..), dopt )
import DynFlags ( DynFlags, GeneralFlag(..), gopt )
import Outputable
import FastString