CmmReturnInfo(..),
CmmStmt(..), CmmActual, CmmActuals, CmmFormal, CmmFormals, CmmKind,
CmmFormalsWithoutKinds, CmmFormalWithoutKind,
+ CmmKinded(..),
CmmSafety(..),
CmmCallTarget(..),
CmmStatic(..), Section(..),
-
- BlockId(..), mkBlockId,
- BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv,
- BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet,
+ module CmmExpr,
) where
#include "HsVersions.h"
+import BlockId
import CmmExpr
import MachOp
import CLabel
import Data.Word
-import ZipCfg ( BlockId(..), mkBlockId
- , BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv
- , BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet
- )
-- A [[BlockId]] is a local label.
-- Local labels must be unique within an entire compilation unit, not
CmmActuals -- with these return values.
type CmmKind = MachHint
-type CmmActual = (CmmExpr, CmmKind)
-type CmmFormal = (LocalReg,CmmKind)
+data CmmKinded a = CmmKinded { kindlessCmm :: a, cmmKind :: CmmKind }
+ deriving (Eq)
+type CmmActual = CmmKinded CmmExpr
+type CmmFormal = CmmKinded LocalReg
type CmmActuals = [CmmActual]
type CmmFormals = [CmmFormal]
type CmmFormalWithoutKind = LocalReg
data CmmSafety = CmmUnsafe | CmmSafe C_SRT
-- | 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 a => UserOfLocalRegs (CmmKinded a) where
+ foldRegsUsed f set (CmmKinded a _) = foldRegsUsed f set a
instance UserOfLocalRegs CmmStmt where
foldRegsUsed f set s = stmt s set
foldRegsUsed f set (CmmCallee e _) = foldRegsUsed f set e
foldRegsUsed _ set (CmmPrim {}) = set
+instance DefinerOfLocalRegs a => DefinerOfLocalRegs (CmmKinded a) where
+ foldRegsDefd f z (CmmKinded x _) = foldRegsDefd f z x
+
+--just look like a tuple, since it was a tuple before
+-- ... is that a good idea? --Isaac Dupree
+instance (Outputable a) => Outputable (CmmKinded a) where
+ ppr (CmmKinded a k) = ppr (a, k)
+
{-
Discussion
~~~~~~~~~~
| CmmPrim -- Call a "primitive" (eg. sin, cos)
CallishMachOp -- These might be implemented as inline
-- code by the backend.
+ deriving Eq
-----------------------------------------------------------------------------
-- Static Data