X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FNCGMonad.hs;h=2a7376838a9b96075de9d4e683165d8c0f928596;hp=ed59d2bd0ae22b922978ddee18d7dce7923128d8;hb=f8f0e76ad302fda30196ebc9230e5fcbc97be537;hpb=b04a210e26ca57242fd052f2aa91011a80b76299 diff --git a/compiler/nativeGen/NCGMonad.hs b/compiler/nativeGen/NCGMonad.hs index ed59d2b..2a73768 100644 --- a/compiler/nativeGen/NCGMonad.hs +++ b/compiler/nativeGen/NCGMonad.hs @@ -90,8 +90,8 @@ mapAccumLNat f b (x:xs) getUniqueNat :: NatM Unique getUniqueNat = NatM $ \ (NatM_State us delta imports pic dflags) -> - case splitUniqSupply us of - (us1,us2) -> (uniqFromSupply us1, (NatM_State us2 delta imports pic dflags)) + case takeUniqFromSupply us of + (uniq, us') -> (uniq, (NatM_State us' delta imports pic dflags)) getDynFlagsNat :: NatM DynFlags @@ -120,7 +120,7 @@ addImportNat imp getBlockIdNat :: NatM BlockId getBlockIdNat = do u <- getUniqueNat - return (BlockId u) + return (mkBlockId u) getNewLabelNat :: NatM CLabel @@ -132,14 +132,16 @@ getNewLabelNat getNewRegNat :: Size -> NatM Reg getNewRegNat rep = do u <- getUniqueNat - return (targetMkVReg u rep) + return (RegVirtual $ targetMkVirtualReg u rep) getNewRegPairNat :: Size -> NatM (Reg,Reg) getNewRegPairNat rep = do u <- getUniqueNat - let lo = targetMkVReg u rep; hi = getHiVRegFromLo lo - return (lo,hi) + let vLo = targetMkVirtualReg u rep + let lo = RegVirtual $ targetMkVirtualReg u rep + let hi = RegVirtual $ getHiVirtualRegFromLo vLo + return (lo, hi) getPicBaseMaybeNat :: NatM (Maybe Reg)