diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-05-15 14:09:46 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-23 17:33:59 -0400 |
commit | 1a4195b04866ebdb5f42006fb92b8a73a4aa2bac (patch) | |
tree | 4bf074e5486b2757ed7620920dadcc35b59c336b | |
parent | bc723ac2cf2cfc329de4b8523bf891965075879b (diff) | |
download | haskell-1a4195b04866ebdb5f42006fb92b8a73a4aa2bac.tar.gz |
Make debug a `Bool` not an `Int` in `StgToCmmConfig`
We don't need any more resolution than this.
Rename the field to `stgToCmmEmitDebugInfo` to indicate it is no longer
conveying any "level" information.
-rw-r--r-- | compiler/GHC/Driver/Config/StgToCmm.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/Config.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/Monad.hs | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/Config/StgToCmm.hs b/compiler/GHC/Driver/Config/StgToCmm.hs index b0b28bf158..38e8f6684d 100644 --- a/compiler/GHC/Driver/Config/StgToCmm.hs +++ b/compiler/GHC/Driver/Config/StgToCmm.hs @@ -22,7 +22,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig , stgToCmmThisModule = mod , stgToCmmTmpDir = tmpDir dflags , stgToCmmContext = initSDocContext dflags defaultDumpStyle - , stgToCmmDebugLevel = debugLevel dflags + , stgToCmmEmitDebugInfo = debugLevel dflags > 0 , stgToCmmBinBlobThresh = b_blob , stgToCmmMaxInlAllocSize = maxInlineAllocSize dflags -- ticky options diff --git a/compiler/GHC/StgToCmm/Config.hs b/compiler/GHC/StgToCmm/Config.hs index 01b3a3f319..f2bd349ae7 100644 --- a/compiler/GHC/StgToCmm/Config.hs +++ b/compiler/GHC/StgToCmm/Config.hs @@ -22,8 +22,8 @@ data StgToCmmConfig = StgToCmmConfig -- Cmm/Parser.y which preloads it with a panic , stgToCmmTmpDir :: !TempDir -- ^ Temp Dir for files used in compilation , stgToCmmContext :: !SDocContext -- ^ Context for StgToCmm phase - , stgToCmmDebugLevel :: !Int -- ^ The verbosity of debug messages - , stgToCmmBinBlobThresh :: !(Maybe Word) -- ^ Threshold at which Binary literals (e.g. strings) + , stgToCmmEmitDebugInfo :: !Bool -- ^ Whether we wish to output debug information + , stgToCmmBinBlobThresh :: !(Maybe Word) -- ^ Threshold at which Binary literals (e.g. strings) -- are either dumped to a file and a CmmFileEmbed literal -- is emitted (over threshold), or become a CmmString -- Literal (under or at threshold). CmmFileEmbed is only supported diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs index 6aa0a2dd08..0c3fd1c68e 100644 --- a/compiler/GHC/StgToCmm/Monad.hs +++ b/compiler/GHC/StgToCmm/Monad.hs @@ -531,7 +531,7 @@ tickScope :: FCode a -> FCode a tickScope code = do cfg <- getStgToCmmConfig fstate <- getFCodeState - if stgToCmmDebugLevel cfg == 0 then code else do + if not $ stgToCmmEmitDebugInfo cfg then code else do u <- newUnique let scope' = SubScope u (fcs_tickscope fstate) withFCodeState code fstate{ fcs_tickscope = scope' } @@ -717,8 +717,8 @@ emitTick = emitCgStmt . CgStmt . CmmTick emitUnwind :: [(GlobalReg, Maybe CmmExpr)] -> FCode () emitUnwind regs = do - debug_level <- stgToCmmDebugLevel <$> getStgToCmmConfig - when (debug_level > 0) $ + debug <- stgToCmmEmitDebugInfo <$> getStgToCmmConfig + when debug $ emitCgStmt $ CgStmt $ CmmUnwind regs emitAssign :: CmmReg -> CmmExpr -> FCode () |