diff options
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r-- | compiler/coreSyn/CoreLint.hs | 6 | ||||
-rw-r--r-- | compiler/coreSyn/CorePrep.hs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index d9116a6f9b..10a93e5281 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -1914,13 +1914,13 @@ lintAnnots pname pass guts = do return nguts -- | Run the given pass without annotations. This means that we both --- remove the @Opt_Debug@ flag from the environment as well as all +-- set the debugLevel setting to 0 in the environment as well as all -- annotations from incoming modules. withoutAnnots :: (ModGuts -> CoreM ModGuts) -> ModGuts -> CoreM ModGuts withoutAnnots pass guts = do -- Remove debug flag from environment. dflags <- getDynFlags - let removeFlag env = env{hsc_dflags = gopt_unset dflags Opt_Debug} + let removeFlag env = env{ hsc_dflags = dflags{ debugLevel = 0} } withoutFlag corem = liftIO =<< runCoreM <$> fmap removeFlag getHscEnv <*> getRuleBase <*> getUniqueSupplyM <*> getModule <*> @@ -1929,7 +1929,7 @@ withoutAnnots pass guts = do pure corem -- Nuke existing ticks in module. -- TODO: Ticks in unfoldings. Maybe change unfolding so it removes - -- them in absence of @Opt_Debug@? + -- them in absence of debugLevel > 0. let nukeTicks = stripTicksE (not . tickishIsCode) nukeAnnotsBind :: CoreBind -> CoreBind nukeAnnotsBind bind = case bind of diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs index e49ece43d2..fdf25d60d9 100644 --- a/compiler/coreSyn/CorePrep.hs +++ b/compiler/coreSyn/CorePrep.hs @@ -221,7 +221,7 @@ mkDataConWorkers dflags mod_loc data_tycons -- If we want to generate debug info, we put a source note on the -- worker. This is useful, especially for heap profiling. tick_it name - | not (gopt Opt_Debug dflags) = id + | debugLevel dflags == 0 = id | RealSrcSpan span <- nameSrcSpan name = tick span | Just file <- ml_hs_file mod_loc = tick (span1 file) | otherwise = tick (span1 "???") |