[commit: ghc] master: Move Stg-specific code from DynFlags to SimplStg (c75948b)
git at git.haskell.org
git at git.haskell.org
Wed Dec 2 20:38:36 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c75948b9dcf5a2761223f4ef3777042982c33cc8/ghc
>---------------------------------------------------------------
commit c75948b9dcf5a2761223f4ef3777042982c33cc8
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Wed Dec 2 14:36:56 2015 -0600
Move Stg-specific code from DynFlags to SimplStg
Reviewed By: bgamari, austin
Differential Revision: https://phabricator.haskell.org/D1552
>---------------------------------------------------------------
c75948b9dcf5a2761223f4ef3777042982c33cc8
compiler/main/DynFlags.hs | 26 --------------------------
compiler/simplStg/SimplStg.hs | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 98c61e7..7779732 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -113,10 +113,6 @@ module DynFlags (
-- ** DynFlags C compiler options
picCCOpts, picPOpts,
- -- * Configuration of the stg-to-stg passes
- StgToDo(..),
- getStgToDo,
-
-- * Compiler configuration suitable for display to the user
compilerInfo,
@@ -2028,28 +2024,6 @@ updOptLevel n dfs
extra_gopts = [ f | (ns,f) <- optLevelFlags, final_n `elem` ns ]
remove_gopts = [ f | (ns,f) <- optLevelFlags, final_n `notElem` ns ]
--- -----------------------------------------------------------------------------
--- StgToDo: abstraction of stg-to-stg passes to run.
-
-data StgToDo
- = StgDoMassageForProfiling -- should be (next to) last
- -- There's also setStgVarInfo, but its absolute "lastness"
- -- is so critical that it is hardwired in (no flag).
- | D_stg_stats
-
-getStgToDo :: DynFlags -> [StgToDo]
-getStgToDo dflags
- = todo2
- where
- stg_stats = gopt Opt_StgStats dflags
-
- todo1 = if stg_stats then [D_stg_stats] else []
-
- todo2 | WayProf `elem` ways dflags
- = StgDoMassageForProfiling : todo1
- | otherwise
- = todo1
-
{- **********************************************************************
%* *
DynFlags parser
diff --git a/compiler/simplStg/SimplStg.hs b/compiler/simplStg/SimplStg.hs
index b8804a4..b8491fc 100644
--- a/compiler/simplStg/SimplStg.hs
+++ b/compiler/simplStg/SimplStg.hs
@@ -87,3 +87,25 @@ stg2stg dflags module_name binds
-- UniqueSupply for the next guy to use
-- cost-centres to be declared/registered (specialised)
-- add to description of what's happened (reverse order)
+
+-- -----------------------------------------------------------------------------
+-- StgToDo: abstraction of stg-to-stg passes to run.
+
+-- | Optional Stg-to-Stg passes.
+data StgToDo
+ = StgDoMassageForProfiling -- should be (next to) last
+ | D_stg_stats
+
+-- | Which optional Stg-to-Stg passes to run. Depends on flags, ways etc.
+getStgToDo :: DynFlags -> [StgToDo]
+getStgToDo dflags
+ = todo2
+ where
+ stg_stats = gopt Opt_StgStats dflags
+
+ todo1 = if stg_stats then [D_stg_stats] else []
+
+ todo2 | WayProf `elem` ways dflags
+ = StgDoMassageForProfiling : todo1
+ | otherwise
+ = todo1
More information about the ghc-commits
mailing list