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/simplCore/Simplify.lhs | |
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/simplCore/Simplify.lhs')
-rw-r--r-- | compiler/simplCore/Simplify.lhs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs index 332643dc6c..f794b88114 100644 --- a/compiler/simplCore/Simplify.lhs +++ b/compiler/simplCore/Simplify.lhs @@ -218,7 +218,7 @@ simplTopBinds env0 binds0 -- See note [Glomming] in OccurAnal. ; env1 <- simplRecBndrs env0 (bindersOfBinds binds0) ; dflags <- getDynFlags - ; let dump_flag = gopt Opt_D_verbose_core2core dflags + ; let dump_flag = dopt Opt_D_verbose_core2core dflags ; env2 <- simpl_binds dump_flag env1 binds0 ; freeTick SimplifierDone ; return env2 } @@ -1420,8 +1420,8 @@ completeCall env var cont }}} where dump_inline dflags unfolding cont - | not (gopt Opt_D_dump_inlinings dflags) = return () - | not (gopt Opt_D_verbose_core2core dflags) + | not (dopt Opt_D_dump_inlinings dflags) = return () + | not (dopt Opt_D_verbose_core2core dflags) = when (isExternalName (idName var)) $ liftIO $ printInfoForUser dflags alwaysQualify $ sep [text "Inlining done:", nest 4 (ppr var)] @@ -1571,14 +1571,14 @@ tryRules env rules fn args call_cont ; return (Just (ruleArity rule, rule_rhs)) }}} where dump dflags rule rule_rhs - | gopt Opt_D_dump_rule_rewrites dflags + | dopt Opt_D_dump_rule_rewrites dflags = log_rule dflags Opt_D_dump_rule_rewrites "Rule fired" $ vcat [ text "Rule:" <+> ftext (ru_name rule) , text "Before:" <+> hang (ppr fn) 2 (sep (map pprParendExpr args)) , text "After: " <+> pprCoreExpr rule_rhs , text "Cont: " <+> ppr call_cont ] - | gopt Opt_D_dump_rule_firings dflags + | dopt Opt_D_dump_rule_firings dflags = log_rule dflags Opt_D_dump_rule_firings "Rule fired:" $ ftext (ru_name rule) |