projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use DynFlags to work out if we are doing ticky ticky profiling
[ghc-hetmet.git]
/
compiler
/
codeGen
/
CgTicky.hs
diff --git
a/compiler/codeGen/CgTicky.hs
b/compiler/codeGen/CgTicky.hs
index
b23b34c
..
27af446
100644
(file)
--- a/
compiler/codeGen/CgTicky.hs
+++ b/
compiler/codeGen/CgTicky.hs
@@
-69,6
+69,8
@@
import PrelNames
import TcType
import TyCon
import TcType
import TyCon
+import DynFlags
+
import Data.Maybe
-----------------------------------------------------------------------------
import Data.Maybe
-----------------------------------------------------------------------------
@@
-190,8
+192,6
@@
tickyReturnOldCon arity
= ifTicky $ do { bumpTickyCounter (sLit "RET_OLD_ctr")
; bumpHistogram (sLit "RET_OLD_hst") arity }
tickyReturnNewCon arity
= ifTicky $ do { bumpTickyCounter (sLit "RET_OLD_ctr")
; bumpHistogram (sLit "RET_OLD_hst") arity }
tickyReturnNewCon arity
- | not opt_DoTickyProfiling = nopC
- | otherwise
= ifTicky $ do { bumpTickyCounter (sLit "RET_NEW_ctr")
; bumpHistogram (sLit "RET_NEW_hst") arity }
= ifTicky $ do { bumpTickyCounter (sLit "RET_NEW_ctr")
; bumpHistogram (sLit "RET_NEW_hst") arity }
@@
-300,9
+300,9
@@
tickyAllocHeap hp
-- Ticky utils
ifTicky :: Code -> Code
-- 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
addToMemLbl :: Width -> CLabel -> Int -> CmmStmt
addToMemLbl rep lbl n = addToMem rep (CmmLit (CmmLabel lbl)) n