summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmHpc.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-03 23:42:17 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-03 23:42:17 +0100
commit7b11baa68c36fdf5e441c76061fec3a38bc5dbbb (patch)
tree18411e954ca515f2830a60d7db166f121a4592e6 /compiler/codeGen/StgCmmHpc.hs
parentaf4f98719e48cbb891bfb6e1c04c577649f32760 (diff)
downloadhaskell-7b11baa68c36fdf5e441c76061fec3a38bc5dbbb.tar.gz
Make -fhpc a dynamic flag
Diffstat (limited to 'compiler/codeGen/StgCmmHpc.hs')
-rw-r--r--compiler/codeGen/StgCmmHpc.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/codeGen/StgCmmHpc.hs b/compiler/codeGen/StgCmmHpc.hs
index 4465e30b04..8f4c8d9223 100644
--- a/compiler/codeGen/StgCmmHpc.hs
+++ b/compiler/codeGen/StgCmmHpc.hs
@@ -17,7 +17,7 @@ import Module
import CmmUtils
import StgCmmUtils
import HscTypes
-import StaticFlags
+import DynFlags
mkTickBox :: Module -> Int -> CmmAGraph
mkTickBox mod n
@@ -35,9 +35,10 @@ initHpc :: Module -> HpcInfo -> FCode ()
initHpc _ (NoHpcInfo {})
= return ()
initHpc this_mod (HpcInfo tickCount _hashNo)
- = whenC opt_Hpc $
- do { emitDataLits (mkHpcTicksLabel this_mod)
- [ (CmmInt 0 W64)
- | _ <- take tickCount [0::Int ..]
- ]
- }
+ = do dflags <- getDynFlags
+ whenC (dopt Opt_Hpc dflags) $
+ do emitDataLits (mkHpcTicksLabel this_mod)
+ [ (CmmInt 0 W64)
+ | _ <- take tickCount [0 :: Int ..]
+ ]
+