summaryrefslogtreecommitdiff
path: root/compiler/cmm/Cmm.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/Cmm.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/Cmm.hs')
-rw-r--r--compiler/cmm/Cmm.hs37
1 files changed, 16 insertions, 21 deletions
diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs
index 24542e1020..db5accd3c0 100644
--- a/compiler/cmm/Cmm.hs
+++ b/compiler/cmm/Cmm.hs
@@ -20,26 +20,17 @@ module Cmm (
CmmInfoTable(..), ClosureTypeInfo(..), ProfilingInfo(..), ClosureTypeTag,
GenBasicBlock(..), CmmBasicBlock, blockId, blockStmts, mapBlockStmts,
CmmReturnInfo(..),
- CmmStmt(..), CmmActuals, CmmFormal, CmmFormals, CmmHintFormals,
+ CmmStmt(..), CmmActual, CmmActuals, CmmFormal, CmmFormals, CmmKind,
+ CmmFormalsWithoutKinds, CmmFormalWithoutKind,
CmmSafety(..),
CmmCallTarget(..),
CmmStatic(..), Section(..),
- CmmExpr(..), cmmExprRep, maybeInvertCmmExpr,
- CmmReg(..), cmmRegRep,
- CmmLit(..), cmmLitRep,
- LocalReg(..), localRegRep, localRegGCFollow, Kind(..),
+ module CmmExpr,
BlockId(..), freshBlockId,
BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv,
BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet,
- GlobalReg(..), globalRegRep,
-
- node, nodeReg, spReg, hpReg, spLimReg
) where
--- ^ In order not to do violence to the import structure of the rest
--- of the compiler, module Cmm re-exports a number of identifiers
--- defined in 'CmmExpr'
-
#include "HsVersions.h"
import CmmExpr
@@ -90,7 +81,8 @@ data GenCmmTop d h g
= CmmProc -- A procedure
h -- Extra header such as the info table
CLabel -- Used to generate both info & entry labels
- CmmFormals -- Argument locals live on entry (C-- procedure params)
+ CmmFormalsWithoutKinds -- Argument locals live on entry (C-- procedure params)
+ -- XXX Odd that there are no kinds, but there you are ---NR
g -- Control-flow graph for the procedure's code
| CmmData -- Static data
@@ -229,7 +221,7 @@ data CmmStmt
| CmmCall -- A call (forign, native or primitive), with
CmmCallTarget
- CmmHintFormals -- zero or more results
+ CmmFormals -- zero or more results
CmmActuals -- zero or more arguments
CmmSafety -- whether to build a continuation
CmmReturnInfo
@@ -250,15 +242,18 @@ data CmmStmt
| CmmReturn -- Return from a native C-- function,
CmmActuals -- with these return values.
-type CmmActual = CmmExpr
-type CmmActuals = [(CmmActual,MachHint)]
-type CmmFormal = LocalReg
-type CmmHintFormals = [(CmmFormal,MachHint)]
-type CmmFormals = [CmmFormal]
+type CmmKind = MachHint
+type CmmActual = (CmmExpr, CmmKind)
+type CmmFormal = (LocalReg,CmmKind)
+type CmmActuals = [CmmActual]
+type CmmFormals = [CmmFormal]
+type CmmFormalWithoutKind = LocalReg
+type CmmFormalsWithoutKinds = [CmmFormalWithoutKind]
+
data CmmSafety = CmmUnsafe | CmmSafe C_SRT
--- | enable us to fold used registers over 'CmmActuals' and 'CmmHintFormals'
-instance UserOfLocalRegs a => UserOfLocalRegs (a, MachHint) where
+-- | enable us to fold used registers over 'CmmActuals' and 'CmmFormals'
+instance UserOfLocalRegs a => UserOfLocalRegs (a, CmmKind) where
foldRegsUsed f set (a, _) = foldRegsUsed f set a
instance UserOfLocalRegs CmmStmt where