diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-10-18 14:59:12 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-10-18 16:01:53 +0100 |
commit | d4a1964300295bfe700caa89f5d28c53eb74bdef (patch) | |
tree | 2afbbf41aad8cc65c0a60d859d5cec4e56532bb2 /compiler/simplStg | |
parent | 51da4ee2401983359db9caad3902a98a8f505431 (diff) | |
download | haskell-d4a1964300295bfe700caa89f5d28c53eb74bdef.tar.gz |
Refactor the way dump flags are handled
We were being inconsistent about how we tested whether dump flags
were enabled; in particular, sometimes we also checked the verbosity,
and sometimes we didn't.
This lead to oddities such as "ghc -v4" printing an "Asm code" section
which didn't contain any code, and "-v4" enabled some parts of
"-ddump-deriv" but not others.
Now all the tests use dopt, which also takes the verbosity into account
as appropriate.
Diffstat (limited to 'compiler/simplStg')
-rw-r--r-- | compiler/simplStg/SimplStg.lhs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/simplStg/SimplStg.lhs b/compiler/simplStg/SimplStg.lhs index caf00a238f..c43b6526b5 100644 --- a/compiler/simplStg/SimplStg.lhs +++ b/compiler/simplStg/SimplStg.lhs @@ -16,8 +16,7 @@ import StgLint ( lintStgBindings ) import StgStats ( showStgStats ) import UnariseStg ( unarise ) -import DynFlags ( DynFlags(..), GeneralFlag(..), gopt, StgToDo(..), - getStgToDo ) +import DynFlags import Module ( Module ) import ErrUtils import SrcLoc @@ -37,8 +36,8 @@ stg2stg dflags module_name binds = do { showPass dflags "Stg2Stg" ; us <- mkSplitUniqSupply 'g' - ; doIfSet_dyn dflags Opt_D_verbose_stg2stg - (log_action dflags dflags SevDump noSrcSpan defaultDumpStyle (text "VERBOSE STG-TO-STG:")) + ; when (dopt Opt_D_verbose_stg2stg dflags) + (log_action dflags dflags SevDump noSrcSpan defaultDumpStyle (text "VERBOSE STG-TO-STG:")) ; (binds', us', ccs) <- end_pass us "Stg2Stg" ([],[],[]) binds |