summaryrefslogtreecommitdiff
path: root/compiler/cmm/DFMonad.hs
diff options
context:
space:
mode:
authorNorman Ramsey <nr@eecs.harvard.edu>2007-09-07 16:12:46 +0000
committerNorman Ramsey <nr@eecs.harvard.edu>2007-09-07 16:12:46 +0000
commitfd8d04119e849f9c713d3e697228846d93c5ca69 (patch)
tree094174348479d042f50a4c85906e9ce8c3b62f88 /compiler/cmm/DFMonad.hs
parent5f0eea10d6a29f3b2a3faf112279a3c98679c9f8 (diff)
downloadhaskell-fd8d04119e849f9c713d3e697228846d93c5ca69.tar.gz
a good deal of salutory renaming
I've renamed a number of type and data constructors within Cmm so that the names used in the compiler may more closely reflect the C-- specification 2.1. I've done a bit of other renaming as well. Highlights: CmmFormal and CmmActual now bear a CmmKind (which for now is a MachHint as before) CmmFormals = [CmmFormal] and CmmActuals = [CmmActual] suitable changes have been made to both code and nonterminals in the Cmm parser (which is as yet untested) For reasons I don't understand, parts of the code generator use a sequence of 'formal parameters' with no C-- kinds. For these we now have the types type CmmFormalWithoutKind = LocalReg type CmmFormalsWithoutKinds = [CmmFormalWithoutKind] A great many appearances of (Tau, MachHint) have been simplified to the appropriate CmmFormal or CmmActual, though I'm sure there are more opportunities. Kind and its data constructors are now renamed to data GCKind = GCKindPtr | GCKindNonPtr to avoid confusion with the Kind used in the type checker and with CmmKind. Finally, in a somewhat unrelated bit (and in honor of Simon PJ, who thought of the name), the Whalley/Davidson 'transaction limit' is now called 'OptimizationFuel' with the net effect that there are no longer two unrelated uses of the abbreviation 'tx'.
Diffstat (limited to 'compiler/cmm/DFMonad.hs')
-rw-r--r--compiler/cmm/DFMonad.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/cmm/DFMonad.hs b/compiler/cmm/DFMonad.hs
index 789b4010b0..fc2fd45cd2 100644
--- a/compiler/cmm/DFMonad.hs
+++ b/compiler/cmm/DFMonad.hs
@@ -1,6 +1,6 @@
{-# OPTIONS -Wall -fno-warn-name-shadowing #-}
module DFMonad
- ( Txlimit
+ ( OptimizationFuel
, DFTx, runDFTx, lastTxPass, txDecrement, txRemaining, txExhausted
, DataflowLattice(..)
@@ -72,7 +72,7 @@ data DFAState f = DFAState { df_facts :: BlockEnv f
, df_facts_change :: ChangeFlag
}
-data DFTxState = DFTxState { df_txlimit :: Txlimit, df_lastpass :: String }
+data DFTxState = DFTxState { df_txlimit :: OptimizationFuel, df_lastpass :: String }
data DFState f = DFState { df_uniqs :: UniqSupply
, df_rewritten :: ChangeFlag
@@ -96,7 +96,7 @@ liftTx (DFTx f) = DFM f'
where f' _ s = let (a, txs) = f (df_txstate s)
in (a, s {df_txstate = txs})
-newtype Txlimit = Txlimit Int
+newtype OptimizationFuel = OptimizationFuel Int
deriving (Ord, Eq, Num, Show, Bounded)
initDFAState :: DFAState f
@@ -108,7 +108,7 @@ 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
-runDFTx :: Txlimit -> DFTx a -> a --- should only be called once per program!
+runDFTx :: OptimizationFuel -> DFTx a -> a --- should only be called once per program!
runDFTx lim (DFTx f) = fst $ f $ DFTxState lim "<none>"
lastTxPass :: DFTx String
@@ -125,11 +125,11 @@ txExhausted :: DFTx Bool
txExhausted = DFTx f
where f s = (df_txlimit s <= 0, s)
-txRemaining :: DFTx Txlimit
+txRemaining :: DFTx OptimizationFuel
txRemaining = DFTx f
where f s = (df_txlimit s, s)
-txDecrement :: String -> Txlimit -> Txlimit -> DFTx ()
+txDecrement :: String -> OptimizationFuel -> OptimizationFuel -> DFTx ()
txDecrement optimizer old new = DFTx f
where f s = ((), s { df_txlimit = lim s, df_lastpass = optimizer })
lim s = if old == df_txlimit s then new
@@ -283,5 +283,5 @@ f4sep [] = fsep []
f4sep (d:ds) = fsep (d : map (nest 4) ds)
-_I_am_abstract :: Int -> Txlimit
-_I_am_abstract = Txlimit -- prevents a warning about Txlimit being unused
+_I_am_abstract :: Int -> OptimizationFuel
+_I_am_abstract = OptimizationFuel -- prevents warning: OptimizationFuel unused