diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-09-03 23:42:17 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-09-03 23:42:17 +0100 |
commit | 7b11baa68c36fdf5e441c76061fec3a38bc5dbbb (patch) | |
tree | 18411e954ca515f2830a60d7db166f121a4592e6 /compiler/codeGen | |
parent | af4f98719e48cbb891bfb6e1c04c577649f32760 (diff) | |
download | haskell-7b11baa68c36fdf5e441c76061fec3a38bc5dbbb.tar.gz |
Make -fhpc a dynamic flag
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/CodeGen.lhs | 3 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmHpc.hs | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/compiler/codeGen/CodeGen.lhs b/compiler/codeGen/CodeGen.lhs index 29193137a7..311f947248 100644 --- a/compiler/codeGen/CodeGen.lhs +++ b/compiler/codeGen/CodeGen.lhs @@ -35,7 +35,6 @@ import OldPprCmm () import StgSyn import PrelNames import DynFlags -import StaticFlags import HscTypes import CostCentre @@ -101,7 +100,7 @@ mkModuleInit mkModuleInit dflags cost_centre_info this_mod hpc_info = do { -- Allocate the static boolean that records if this - ; whenC (opt_Hpc) $ + ; whenC (dopt Opt_Hpc dflags) $ hpcTable this_mod hpc_info ; whenC (dopt Opt_SccProfilingOn dflags) $ do 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 ..] + ] + |