summaryrefslogtreecommitdiff
path: root/compiler/profiling
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/profiling
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/profiling')
-rw-r--r--compiler/profiling/ProfInit.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/profiling/ProfInit.hs b/compiler/profiling/ProfInit.hs
index 7e223f80e9..0866c03395 100644
--- a/compiler/profiling/ProfInit.hs
+++ b/compiler/profiling/ProfInit.hs
@@ -10,8 +10,8 @@ module ProfInit (profilingInitCode) where
import CLabel
import CostCentre
+import DynFlags
import Outputable
-import StaticFlags
import FastString
import Module
@@ -23,9 +23,10 @@ import Module
profilingInitCode :: Module -> CollectedCCs -> SDoc
profilingInitCode this_mod (local_CCs, ___extern_CCs, singleton_CCSs)
- | not opt_SccProfilingOn = empty
- | otherwise
- = vcat
+ = sdocWithDynFlags $ \dflags ->
+ if not (dopt Opt_SccProfilingOn dflags)
+ then empty
+ else vcat
[ text "static void prof_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void prof_init_" <> ppr this_mod <> text "(void)"