X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmm.hs;h=53a6d0addf9444dd37049bdb25d3823185882d2a;hb=90b9566607ef837329434657c8fabc4bdffdf1af;hp=b535c8dbd221dbdee492794678c6b63560599dc3;hpb=c92fecad2314baf305292174a14ba383465157a4;p=ghc-hetmet.git diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index b535c8d..53a6d0a 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -18,9 +18,11 @@ module Cmm ( CmmReturnInfo(..), CmmStmt(..), CmmActual, CmmActuals, CmmFormal, CmmFormals, CmmKind, CmmFormalsWithoutKinds, CmmFormalWithoutKind, + CmmKinded(..), CmmSafety(..), CmmCallTarget(..), CmmStatic(..), Section(..), + module CmmExpr, BlockId(..), mkBlockId, BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv, @@ -239,8 +241,10 @@ data CmmStmt 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 @@ -249,8 +253,8 @@ type CmmFormalsWithoutKinds = [CmmFormalWithoutKind] 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 @@ -270,6 +274,11 @@ instance UserOfLocalRegs CmmCallTarget where foldRegsUsed f set (CmmCallee e _) = foldRegsUsed f set e foldRegsUsed _ set (CmmPrim {}) = set +--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 ~~~~~~~~~~