summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CmmParse.y2
-rw-r--r--compiler/cmm/CmmUtils.hs19
2 files changed, 9 insertions, 12 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index 4d7e288381..8cc988383e 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -542,7 +542,7 @@ info :: { CmmParse (CLabel, Maybe CmmInfoTable, [LocalReg]) }
live <- sequence $7
let prof = NoProfilingInfo
-- drop one for the info pointer
- bitmap = mkLiveness dflags (map Just (drop 1 live))
+ bitmap = mkLiveness dflags (drop 1 live)
rep = mkRTSRep (fromIntegral $5) $ mkStackRep bitmap
return (mkCmmRetLabel pkg $3,
Just $ CmmInfoTable { cit_lbl = mkCmmRetInfoLabel pkg $3
diff --git a/compiler/cmm/CmmUtils.hs b/compiler/cmm/CmmUtils.hs
index 1ae5526074..42d64842e2 100644
--- a/compiler/cmm/CmmUtils.hs
+++ b/compiler/cmm/CmmUtils.hs
@@ -456,20 +456,17 @@ regUsedIn dflags = regUsedIn_ where
--
---------------------------------------------
-mkLiveness :: DynFlags -> [Maybe LocalReg] -> Liveness
+mkLiveness :: DynFlags -> [LocalReg] -> Liveness
mkLiveness _ [] = []
mkLiveness dflags (reg:regs)
- = take sizeW bits ++ mkLiveness dflags regs
+ = bits ++ mkLiveness dflags regs
where
- sizeW = case reg of
- Nothing -> 1
- Just r -> (widthInBytes (typeWidth (localRegType r)) + wORD_SIZE dflags - 1)
- `quot` wORD_SIZE dflags
- -- number of words, rounded up
- bits = repeat $ is_non_ptr reg -- True <=> Non Ptr
-
- is_non_ptr Nothing = True
- is_non_ptr (Just reg) = not $ isGcPtrType (localRegType reg)
+ sizeW = (widthInBytes (typeWidth (localRegType reg)) + wORD_SIZE dflags - 1)
+ `quot` wORD_SIZE dflags
+ -- number of words, rounded up
+ bits = replicate sizeW is_non_ptr -- True <=> Non Ptr
+
+ is_non_ptr = not $ isGcPtrType (localRegType reg)
-- ============================================== -