summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Hpc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/StgToCmm/Hpc.hs')
-rw-r--r--compiler/GHC/StgToCmm/Hpc.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/GHC/StgToCmm/Hpc.hs b/compiler/GHC/StgToCmm/Hpc.hs
index 707fe9725a..23e7519d80 100644
--- a/compiler/GHC/StgToCmm/Hpc.hs
+++ b/compiler/GHC/StgToCmm/Hpc.hs
@@ -11,8 +11,6 @@ module GHC.StgToCmm.Hpc ( initHpc, mkTickBox ) where
import GHC.Prelude
import GHC.Platform
-import GHC.Driver.Session
-
import GHC.StgToCmm.Monad
import GHC.StgToCmm.Utils
@@ -39,13 +37,13 @@ mkTickBox platform mod n
-- | Emit top-level tables for HPC and return code to initialise
initHpc :: Module -> HpcInfo -> FCode ()
-initHpc _ (NoHpcInfo {})
+initHpc _ NoHpcInfo{}
= return ()
initHpc this_mod (HpcInfo tickCount _hashNo)
- = do dflags <- getDynFlags
- when (gopt Opt_Hpc dflags) $
+ = do do_hpc <- stgToCmmOptHpc <$> getStgToCmmConfig
+ when do_hpc $
emitDataLits (mkHpcTicksLabel this_mod)
- [ (CmmInt 0 W64)
+ [ CmmInt 0 W64
| _ <- take tickCount [0 :: Int ..]
]