summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-18 14:59:12 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-18 16:01:53 +0100
commitd4a1964300295bfe700caa89f5d28c53eb74bdef (patch)
tree2afbbf41aad8cc65c0a60d859d5cec4e56532bb2 /compiler/nativeGen
parent51da4ee2401983359db9caad3902a98a8f505431 (diff)
downloadhaskell-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/nativeGen')
-rw-r--r--compiler/nativeGen/AsmCodeGen.lhs8
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Main.hs6
2 files changed, 7 insertions, 7 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
index a233a8ffba..ef61adfbec 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -356,8 +356,8 @@ cmmNativeGens dflags ncgImpl h us (cmm : cmms) impAcc profAcc count
-- and then using 'seq' doesn't work, because the let
-- apparently gets inlined first.
lsPprNative <- return $!
- if gopt Opt_D_dump_asm dflags
- || gopt Opt_D_dump_asm_stats dflags
+ if dopt Opt_D_dump_asm dflags
+ || dopt Opt_D_dump_asm_stats dflags
then native
else []
@@ -466,7 +466,7 @@ cmmNativeGen dflags ncgImpl us cmm count
$ zip [0..] regAllocStats)
let mPprStats =
- if gopt Opt_D_dump_asm_stats dflags
+ if dopt Opt_D_dump_asm_stats dflags
then Just regAllocStats else Nothing
-- force evaluation of the Maybe to avoid space leak
@@ -498,7 +498,7 @@ cmmNativeGen dflags ncgImpl us cmm count
(vcat $ map (pprNatCmmDecl ncgImpl) alloced)
let mPprStats =
- if gopt Opt_D_dump_asm_stats dflags
+ if dopt Opt_D_dump_asm_stats dflags
then Just (catMaybes regAllocStats) else Nothing
-- force evaluation of the Maybe to avoid space leak
diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/nativeGen/RegAlloc/Graph/Main.hs
index 57c150b6b0..defe68cff3 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Main.hs
@@ -91,9 +91,9 @@ regAlloc_spin dflags spinCount triv regsFree slotsFree debug_codeGraphs code
-- intermediate structures in the allocator - otherwise tell the
-- allocator to ditch them early so we don't end up creating space leaks.
let dump = or
- [ gopt Opt_D_dump_asm_regalloc_stages dflags
- , gopt Opt_D_dump_asm_stats dflags
- , gopt Opt_D_dump_asm_conflicts dflags ]
+ [ dopt Opt_D_dump_asm_regalloc_stages dflags
+ , dopt Opt_D_dump_asm_stats dflags
+ , dopt Opt_D_dump_asm_conflicts dflags ]
-- check that we're not running off down the garden path.
when (spinCount > maxSpinCount)