X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmm.hs;h=5ad8ee7dcfc92bb14e1fc49e19acaded792cb9bc;hb=b4fd46494dc922a8e1134c9396cada1f10e74e55;hp=c2f8d48e73b4f180ebd575ec3802f0e1cae0448e;hpb=f2cc8b5bc34519a65581dc40b7bfebac97bffd73;p=ghc-hetmet.git diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index c2f8d48..5ad8ee7 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -10,7 +10,7 @@ module Cmm ( GenCmm(..), Cmm, GenCmmTop(..), CmmTop, GenBasicBlock(..), CmmBasicBlock, blockId, blockStmts, - CmmStmt(..), + CmmStmt(..), CmmActuals, CmmFormals, CmmCallTarget(..), CmmStatic(..), Section(..), CmmExpr(..), cmmExprRep, @@ -20,7 +20,7 @@ module Cmm ( BlockId(..), GlobalReg(..), globalRegRep, - node, nodeReg, spReg, hpReg, + node, nodeReg, spReg, hpReg, spLimReg ) where #include "HsVersions.h" @@ -113,8 +113,8 @@ data CmmStmt | CmmCall -- A foreign call, with CmmCallTarget - [(CmmReg,MachHint)] -- zero or more results - [(CmmExpr,MachHint)] -- zero or more arguments + 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 @@ -131,10 +131,13 @@ data CmmStmt -- Undefined outside range, and when there's a Nothing | CmmJump CmmExpr -- Jump to another function, - [(CmmExpr, MachHint)] -- with these parameters. + CmmActuals -- with these parameters. | CmmReturn -- Return from a function, - [(CmmExpr, MachHint)] -- with these return values. + CmmActuals -- with these return values. + +type CmmActuals = [(CmmExpr,MachHint)] +type CmmFormals = [(CmmReg,MachHint)] {- Discussion @@ -272,6 +275,8 @@ newtype BlockId = BlockId Unique instance Uniquable BlockId where getUnique (BlockId u) = u +type BlockEnv a = UniqFM {- BlockId -} a + ----------------------------------------------------------------------------- -- Static Data ----------------------------------------------------------------------------- @@ -348,9 +353,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