diff options
author | Norman Ramsey <nr@eecs.harvard.edu> | 2007-09-15 21:51:38 +0000 |
---|---|---|
committer | Norman Ramsey <nr@eecs.harvard.edu> | 2007-09-15 21:51:38 +0000 |
commit | c8bebd3d95f8ec4d723b5628108745c8174bb3c4 (patch) | |
tree | 4af0d8fde39e414aff74d5bd9909000131cfb49f | |
parent | d5036717526fdd27f6a1c770fd19a6090af60254 (diff) | |
download | haskell-c8bebd3d95f8ec4d723b5628108745c8174bb3c4.tar.gz |
add another way to run in the fuel monad (this is a mess right now)
-rw-r--r-- | compiler/cmm/DFMonad.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/cmm/DFMonad.hs b/compiler/cmm/DFMonad.hs index e8afab42ad..970cdcb943 100644 --- a/compiler/cmm/DFMonad.hs +++ b/compiler/cmm/DFMonad.hs @@ -2,6 +2,7 @@ module DFMonad ( OptimizationFuel , DFTx, runDFTx, lastTxPass, txDecrement, txRemaining, txExhausted + , functionalDFTx , DataflowLattice(..) , DataflowAnalysis @@ -108,6 +109,11 @@ runDFA lattice (DFA f) = fst $ f lattice initDFAState -- XXX DFTx really needs to be in IO, so we can dump programs in -- intermediate states of optimization ---NR +functionalDFTx :: String -> (OptimizationFuel -> (a, OptimizationFuel)) -> DFTx a +functionalDFTx name pass = DFTx f + where f s = let (a, fuel) = pass (df_txlimit s) + in (a, DFTxState fuel name) + runDFTx :: OptimizationFuel -> DFTx a -> a --- should only be called once per program! runDFTx lim (DFTx f) = fst $ f $ DFTxState lim "<none>" |