Make some profiling flags dynamic
[ghc-hetmet.git] / compiler / simplStg / SimplStg.lhs
index e87877c..4c240e2 100644 (file)
@@ -16,7 +16,6 @@ import StgLint                ( lintStgBindings )
 import StgStats                ( showStgStats )
 import SRT             ( computeSRTs )
 
-import Packages                ( HomeModules )
 import DynFlags                ( DynFlags(..), DynFlag(..), dopt, StgToDo(..),
                          getStgToDo )
 import Id              ( Id )
@@ -28,13 +27,12 @@ import Outputable
 
 \begin{code}
 stg2stg :: DynFlags                 -- includes spec of what stg-to-stg passes to do
-       -> HomeModules
        -> Module                    -- module name (profiling only)
        -> [StgBinding]              -- input...
        -> IO ( [(StgBinding,[(Id,[Id])])]  -- output program...
              , CollectedCCs)        -- cost centre information (declared and used)
 
-stg2stg dflags pkg_deps module_name binds
+stg2stg dflags module_name binds
   = do { showPass dflags "Stg2Stg"
        ; us <- mkSplitUniqSupply 'g'
 
@@ -58,7 +56,7 @@ stg2stg dflags pkg_deps module_name binds
   where
     stg_linter = if dopt Opt_DoStgLinting dflags
                 then lintStgBindings
-                else ( \ whodunnit binds -> binds )
+                else ( \ _whodunnit binds -> binds )
 
     -------------------------------------------
     do_stg_pass (binds, us, ccs) to_do
@@ -74,7 +72,8 @@ stg2stg dflags pkg_deps module_name binds
             {-# SCC "ProfMassage" #-}
             let
                 (collected_CCs, binds3)
-                  = stgMassageForProfiling pkg_deps module_name us1 binds
+                  = stgMassageForProfiling dflags this_pkg module_name us1 binds
+                this_pkg = thisPackage dflags
             in
             end_pass us2 "ProfMassage" collected_CCs binds3
 
@@ -90,7 +89,8 @@ stg2stg dflags pkg_deps module_name binds
            --         add to description of what's happened (reverse order)
 
 -- here so it can be inlined...
-foldl_mn f z []     = return z
+foldl_mn :: (b -> a -> IO b) -> b -> [a] -> IO b
+foldl_mn _ z []     = return z
 foldl_mn f z (x:xs) = f z x    >>= \ zz ->
                     foldl_mn f zz xs
 \end{code}