projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2001-10-24 15:11:28 by simonpj]
[ghc-hetmet.git]
/
ghc
/
compiler
/
basicTypes
/
Literal.lhs
diff --git
a/ghc/compiler/basicTypes/Literal.lhs
b/ghc/compiler/basicTypes/Literal.lhs
index
7df6fca
..
2167ba0
100644
(file)
--- a/
ghc/compiler/basicTypes/Literal.lhs
+++ b/
ghc/compiler/basicTypes/Literal.lhs
@@
-13,6
+13,7
@@
module Literal
, hashLiteral
, inIntRange, inWordRange, tARGET_MAX_INT, inCharRange
, hashLiteral
, inIntRange, inWordRange, tARGET_MAX_INT, inCharRange
+ , isZeroLit,
, word2IntLit, int2WordLit
, narrow8IntLit, narrow16IntLit, narrow32IntLit
, word2IntLit, int2WordLit
, narrow8IntLit, narrow16IntLit, narrow32IntLit
@@
-163,6
+164,15
@@
inWordRange x = x >= 0 && x <= tARGET_MAX_WORD
inCharRange :: Int -> Bool
inCharRange c = c >= 0 && c <= tARGET_MAX_CHAR
inCharRange :: Int -> Bool
inCharRange c = c >= 0 && c <= tARGET_MAX_CHAR
+
+isZeroLit :: Literal -> Bool
+isZeroLit (MachInt 0) = True
+isZeroLit (MachInt64 0) = True
+isZeroLit (MachWord 0) = True
+isZeroLit (MachWord64 0) = True
+isZeroLit (MachFloat 0) = True
+isZeroLit (MachDouble 0) = True
+isZeroLit other = False
\end{code}
Coercions
\end{code}
Coercions