projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Major cleanup of the CPS code (but more is still to come)
[ghc-hetmet.git]
/
compiler
/
cmm
/
Cmm.hs
diff --git
a/compiler/cmm/Cmm.hs
b/compiler/cmm/Cmm.hs
index
c2f8d48
..
0d1876e
100644
(file)
--- a/
compiler/cmm/Cmm.hs
+++ b/
compiler/cmm/Cmm.hs
@@
-10,17
+10,17
@@
module Cmm (
GenCmm(..), Cmm,
GenCmmTop(..), CmmTop,
GenBasicBlock(..), CmmBasicBlock, blockId, blockStmts,
GenCmm(..), Cmm,
GenCmmTop(..), CmmTop,
GenBasicBlock(..), CmmBasicBlock, blockId, blockStmts,
- CmmStmt(..),
+ CmmStmt(..), CmmActuals, CmmFormals,
CmmCallTarget(..),
CmmStatic(..), Section(..),
CmmExpr(..), cmmExprRep,
CmmReg(..), cmmRegRep,
CmmLit(..), cmmLitRep,
LocalReg(..), localRegRep,
CmmCallTarget(..),
CmmStatic(..), Section(..),
CmmExpr(..), cmmExprRep,
CmmReg(..), cmmRegRep,
CmmLit(..), cmmLitRep,
LocalReg(..), localRegRep,
- BlockId(..),
+ BlockId(..), BlockEnv,
GlobalReg(..), globalRegRep,
GlobalReg(..), globalRegRep,
- node, nodeReg, spReg, hpReg,
+ node, nodeReg, spReg, hpReg, spLimReg
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
@@
-29,6
+29,7
@@
import MachOp
import CLabel
import ForeignCall
import Unique
import CLabel
import ForeignCall
import Unique
+import UniqFM
import FastString
import Data.Word
import FastString
import Data.Word
@@
-113,8
+114,8
@@
data CmmStmt
| CmmCall -- A foreign call, with
CmmCallTarget
| 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
(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
+132,13
@@
data CmmStmt
-- Undefined outside range, and when there's a Nothing
| CmmJump CmmExpr -- Jump to another function,
-- 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,
| 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
{-
Discussion
@@
-272,6
+276,8
@@
newtype BlockId = BlockId Unique
instance Uniquable BlockId where
getUnique (BlockId u) = u
instance Uniquable BlockId where
getUnique (BlockId u) = u
+type BlockEnv a = UniqFM {- BlockId -} a
+
-----------------------------------------------------------------------------
-- Static Data
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-- Static Data
-----------------------------------------------------------------------------
@@
-348,9
+354,10
@@
data GlobalReg
)
-- convenient aliases
)
-- convenient aliases
-spReg, hpReg, nodeReg :: CmmReg
+spReg, hpReg, spLimReg, nodeReg :: CmmReg
spReg = CmmGlobal Sp
hpReg = CmmGlobal Hp
spReg = CmmGlobal Sp
hpReg = CmmGlobal Hp
+spLimReg = CmmGlobal SpLim
nodeReg = CmmGlobal node
node :: GlobalReg
nodeReg = CmmGlobal node
node :: GlobalReg