summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgTicky.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen/CgTicky.hs')
-rw-r--r--compiler/codeGen/CgTicky.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/codeGen/CgTicky.hs b/compiler/codeGen/CgTicky.hs
index 5422127ae5..27af4461b1 100644
--- a/compiler/codeGen/CgTicky.hs
+++ b/compiler/codeGen/CgTicky.hs
@@ -69,6 +69,8 @@ import PrelNames
import TcType
import TyCon
+import DynFlags
+
import Data.Maybe
-----------------------------------------------------------------------------
@@ -298,9 +300,9 @@ tickyAllocHeap hp
-- Ticky utils
ifTicky :: Code -> Code
-ifTicky code
- | opt_DoTickyProfiling = code
- | otherwise = nopC
+ifTicky code = do dflags <- getDynFlags
+ if doingTickyProfiling dflags then code
+ else nopC
addToMemLbl :: Width -> CLabel -> Int -> CmmStmt
addToMemLbl rep lbl n = addToMem rep (CmmLit (CmmLabel lbl)) n