projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Link with hpc even if GhcWithInterpreter is not set
[ghc-hetmet.git]
/
compiler
/
basicTypes
/
Literal.lhs
diff --git
a/compiler/basicTypes/Literal.lhs
b/compiler/basicTypes/Literal.lhs
index
f05d1bf
..
a5c413a
100644
(file)
--- a/
compiler/basicTypes/Literal.lhs
+++ b/
compiler/basicTypes/Literal.lhs
@@
-16,6
+16,7
@@
module Literal
, inIntRange, inWordRange, tARGET_MAX_INT, inCharRange
, isZeroLit
, inIntRange, inWordRange, tARGET_MAX_INT, inCharRange
, isZeroLit
+ , litFitsInChar
, word2IntLit, int2WordLit
, narrow8IntLit, narrow16IntLit, narrow32IntLit
, word2IntLit, int2WordLit
, narrow8IntLit, narrow16IntLit, narrow32IntLit
@@
-34,7
+35,6
@@
import FastTypes
import FastString
import Binary
import Ratio
import FastString
import Binary
import Ratio
-import FastString
import Data.Int
import Data.Word
import Data.Int
import Data.Word
@@
-285,6
+285,12
@@
litIsDupable :: Literal -> Bool
litIsDupable (MachStr _) = False
litIsDupable other = True
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)
litSize :: Literal -> Int
-- Used by CoreUnfold.sizeExpr
litSize (MachStr str) = 1 + ((lengthFS str + 3) `div` 4)