CmmReg(..), cmmRegRep,
CmmLit(..), cmmLitRep,
LocalReg(..), localRegRep,
- BlockId(..),
+ BlockId(..), BlockEnv,
GlobalReg(..), globalRegRep,
- node, nodeReg, spReg, hpReg,
+ node, nodeReg, spReg, hpReg, spLimReg
) where
#include "HsVersions.h"
import CLabel
import ForeignCall
import Unique
+import UniqFM
import FastString
import Data.Word
= CmmProc
[d] -- Info table, may be empty
CLabel -- Used to generate both info & entry labels
- [LocalReg] -- Argument locals live on entry (C-- procedure params)
+ CmmFormals -- Argument locals live on entry (C-- procedure params)
[GenBasicBlock i] -- Code, may be empty. The first block is
-- the entry point. The order is otherwise initially
-- unimportant, but at some point the code gen will
CmmCallTarget
CmmFormals -- zero or more results
CmmActuals -- zero or more arguments
- (Maybe [GlobalReg]) -- Global regs that may need to be saved
- -- if they will be clobbered by the call.
- -- Nothing <=> save *all* globals that
- -- might be clobbered.
| CmmBranch BlockId -- branch to another BB in this fn
-- Undefined outside range, and when there's a Nothing
| CmmJump CmmExpr -- Jump to another function,
- CmmActuals -- with these parameters.
+ CmmActuals -- with these parameters.
| CmmReturn -- Return from a function,
- CmmActuals -- with these return values.
+ CmmActuals -- with these return values.
type CmmActuals = [(CmmExpr,MachHint)]
type CmmFormals = [(CmmReg,MachHint)]
instance Uniquable BlockId where
getUnique (BlockId u) = u
+type BlockEnv a = UniqFM {- BlockId -} a
+
-----------------------------------------------------------------------------
-- Static Data
-----------------------------------------------------------------------------
)
-- 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