-- places in generated code (stack frame liveness masks, function
-- argument liveness masks, SRT bitmaps).
+{-# OPTIONS_GHC -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+-- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- for details
+
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
foldr (.|.) 0 [ 1 `shiftL` n | (True,n) <- zip chunk [0..] ]
-- | Make a bitmap where the slots specified are the /ones/ in the bitmap.
--- eg. @[1,2,4], size 4 ==> 0xb@.
+-- eg. @[0,1,3], size 4 ==> 0xb@.
--
-- The list of @Int@s /must/ be already sorted.
intsToBitmap :: Int -> [Int] -> Bitmap
where (these,rest) = span (<wORD_SIZE_IN_BITS) slots
-- | Make a bitmap where the slots specified are the /zeros/ in the bitmap.
--- eg. @[1,2,4], size 4 ==> 0x8@ (we leave any bits outside the size as zero,
+-- eg. @[0,1,3], size 4 ==> 0x4@ (we leave any bits outside the size as zero,
-- just to make the bitmap easier to read).
--
-- The list of @Int@s /must/ be already sorted.