summaryrefslogtreecommitdiff
path: root/compiler/simplCore/SAT.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2008-10-30 12:51:08 +0000
committersimonpj@microsoft.com <unknown>2008-10-30 12:51:08 +0000
commit9bcd95bad83ee937c178970e8b729732e680fe1e (patch)
treee0cbcf15a961d05da7b12b45b9aaf0efb4672338 /compiler/simplCore/SAT.lhs
parentb1f3ff48870a3a4670cb41b890b78bbfffa8a32e (diff)
downloadhaskell-9bcd95bad83ee937c178970e8b729732e680fe1e.tar.gz
Add (a) CoreM monad, (b) new Annotations feature
This patch, written by Max Bolingbroke, does two things 1. It adds a new CoreM monad (defined in simplCore/CoreMonad), which is used as the top-level monad for all the Core-to-Core transformations (starting at SimplCore). It supports * I/O (for debug printing) * Unique supply * Statistics gathering * Access to the HscEnv, RuleBase, Annotations, Module The patch therefore refactors the top "skin" of every Core-to-Core pass, but does not change their functionality. 2. It adds a completely new facility to GHC: Core "annotations". The idea is that you can say {#- ANN foo (Just "Hello") #-} which adds the annotation (Just "Hello") to the top level function foo. These annotations can be looked up in any Core-to-Core pass, and are persisted into interface files. (Hence a Core-to-Core pass can also query the annotations of imported things.) Furthermore, a Core-to-Core pass can add new annotations (eg strictness info) of its own, which can be queried by importing modules. The design of the annotation system is somewhat in flux. It's designed to work with the (upcoming) dynamic plug-ins mechanism, but is meanwhile independently useful. Do not merge to 6.10!
Diffstat (limited to 'compiler/simplCore/SAT.lhs')
-rw-r--r--compiler/simplCore/SAT.lhs11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/simplCore/SAT.lhs b/compiler/simplCore/SAT.lhs
index 329c95ca11..ca251568a7 100644
--- a/compiler/simplCore/SAT.lhs
+++ b/compiler/simplCore/SAT.lhs
@@ -52,10 +52,8 @@ essential to make this work well!
module SAT ( doStaticArgs ) where
-import DynFlags
import Var
import CoreSyn
-import CoreLint
import CoreUtils
import Type
import TcType
@@ -78,11 +76,8 @@ import FastString
\end{code}
\begin{code}
-doStaticArgs :: DynFlags -> UniqSupply -> [CoreBind] -> IO [CoreBind]
-doStaticArgs dflags us binds = do
- showPass dflags "Static argument"
- let binds' = snd $ mapAccumL sat_bind_threaded_us us binds
- endPass dflags "Static argument" Opt_D_verbose_core2core binds'
+doStaticArgs :: UniqSupply -> [CoreBind] -> [CoreBind]
+doStaticArgs us binds = snd $ mapAccumL sat_bind_threaded_us us binds
where
sat_bind_threaded_us us bind =
let (us1, us2) = splitUniqSupply us
@@ -428,4 +423,4 @@ isStaticValue :: Staticness App -> Bool
isStaticValue (Static (VarApp _)) = True
isStaticValue _ = False
-\end{code} \ No newline at end of file
+\end{code}