Major cleanup of the CPS code (but more is still to come)
[ghc-hetmet.git] / compiler / cmm / Cmm.hs
index d3bdead..0d1876e 100644 (file)
@@ -17,10 +17,10 @@ module Cmm (
        CmmReg(..), cmmRegRep,
        CmmLit(..), cmmLitRep,
        LocalReg(..), localRegRep,
-       BlockId(..),
+       BlockId(..), BlockEnv,
        GlobalReg(..), globalRegRep,
 
-       node, nodeReg, spReg, hpReg,
+       node, nodeReg, spReg, hpReg, spLimReg
   ) where
 
 #include "HsVersions.h"
@@ -29,6 +29,7 @@ import MachOp
 import CLabel
 import ForeignCall
 import Unique
+import UniqFM
 import FastString
 
 import Data.Word
@@ -275,6 +276,8 @@ newtype BlockId = BlockId Unique
 instance Uniquable BlockId where
   getUnique (BlockId u) = u
 
+type BlockEnv a = UniqFM {- BlockId -} a
+
 -----------------------------------------------------------------------------
 --             Static Data
 -----------------------------------------------------------------------------
@@ -351,9 +354,10 @@ data GlobalReg
         )
 
 -- convenient aliases
-spReg, hpReg, nodeReg :: CmmReg
+spReg, hpReg, spLimReg, nodeReg :: CmmReg
 spReg = CmmGlobal Sp
 hpReg = CmmGlobal Hp
+spLimReg = CmmGlobal SpLim
 nodeReg = CmmGlobal node
 
 node :: GlobalReg