summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgCase.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-07-24 20:26:52 +0100
committerIan Lynagh <igloo@earth.li>2012-07-24 20:41:06 +0100
commit229e9fc585b3003f2c26cbcf39f71a87514cd43d (patch)
tree8214619d18d6d4024dee307435ff9e46d4ee5dbb /compiler/codeGen/CgCase.lhs
parent4b18cc53a81634951cc72aa5c3e2123688b6f512 (diff)
downloadhaskell-229e9fc585b3003f2c26cbcf39f71a87514cd43d.tar.gz
Make -fscc-profiling a dynamic flag
All the flags that 'ways' imply are now dynamic
Diffstat (limited to 'compiler/codeGen/CgCase.lhs')
-rw-r--r--compiler/codeGen/CgCase.lhs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/codeGen/CgCase.lhs b/compiler/codeGen/CgCase.lhs
index 745bf47710..ef51aaa620 100644
--- a/compiler/codeGen/CgCase.lhs
+++ b/compiler/codeGen/CgCase.lhs
@@ -32,8 +32,8 @@ import ClosureInfo
import OldCmmUtils
import OldCmm
+import DynFlags
import StgSyn
-import StaticFlags
import Id
import ForeignCall
import VarSet
@@ -650,13 +650,13 @@ saveCurrentCostCentre ::
CmmStmts) -- Assignment to save it
saveCurrentCostCentre
- | not opt_SccProfilingOn
- = returnFC (Nothing, noStmts)
- | otherwise
- = do { slot <- allocPrimStack PtrArg
- ; sp_rel <- getSpRelOffset slot
- ; returnFC (Just slot,
- oneStmt (CmmStore sp_rel curCCS)) }
+ = do dflags <- getDynFlags
+ if not (dopt Opt_SccProfilingOn dflags)
+ then returnFC (Nothing, noStmts)
+ else do slot <- allocPrimStack PtrArg
+ sp_rel <- getSpRelOffset slot
+ returnFC (Just slot,
+ oneStmt (CmmStore sp_rel curCCS))
-- Sometimes we don't free the slot containing the cost centre after restoring it
-- (see CgLetNoEscape.cgLetNoEscapeBody).