, inIntRange, inWordRange, tARGET_MAX_INT, inCharRange
, isZeroLit
+ , litFitsInChar
, word2IntLit, int2WordLit
, narrow8IntLit, narrow16IntLit, narrow32IntLit
import FastString
import Binary
import Ratio
-import FastString
import Data.Int
import Data.Word
litIsDupable (MachStr _) = False
litIsDupable other = True
+litFitsInChar :: Literal -> Bool
+litFitsInChar (MachInt i)
+ = fromInteger i <= ord minBound
+ && fromInteger i >= ord maxBound
+litFitsInChar _ = False
+
litSize :: Literal -> Int
-- Used by CoreUnfold.sizeExpr
litSize (MachStr str) = 1 + ((lengthFS str + 3) `div` 4)