Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
80cf4cf0
Commit
80cf4cf0
authored
Jun 08, 2016
by
Ömer Sinan Ağacan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Literal: Remove unused hashLiteral function
parent
c2bbc8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
37 deletions
+0
-37
compiler/basicTypes/Literal.hs
compiler/basicTypes/Literal.hs
+0
-37
No files found.
compiler/basicTypes/Literal.hs
View file @
80cf4cf0
...
@@ -21,7 +21,6 @@ module Literal
...
@@ -21,7 +21,6 @@ module Literal
-- ** Operations on Literals
-- ** Operations on Literals
,
literalType
,
literalType
,
hashLiteral
,
absentLiteralOf
,
absentLiteralOf
,
pprLiteral
,
pprLiteral
...
@@ -58,7 +57,6 @@ import Util
...
@@ -58,7 +57,6 @@ import Util
import
Data.ByteString
(
ByteString
)
import
Data.ByteString
(
ByteString
)
import
Data.Int
import
Data.Int
import
Data.Ratio
import
Data.Word
import
Data.Word
import
Data.Char
import
Data.Char
import
Data.Data
(
Data
)
import
Data.Data
(
Data
)
...
@@ -500,38 +498,3 @@ MachDouble -1.0##
...
@@ -500,38 +498,3 @@ MachDouble -1.0##
LitInteger -1 (-1)
LitInteger -1 (-1)
MachLabel "__label" ... ("__label" ...)
MachLabel "__label" ... ("__label" ...)
-}
-}
{-
************************************************************************
* *
\subsection{Hashing}
* *
************************************************************************
Hash values should be zero or a positive integer. No negatives please.
(They mess up the UniqFM for some reason.)
-}
hashLiteral
::
Literal
->
Int
hashLiteral
(
MachChar
c
)
=
ord
c
+
1000
-- Keep it out of range of common ints
hashLiteral
(
MachStr
s
)
=
hashByteString
s
hashLiteral
(
MachNullAddr
)
=
0
hashLiteral
(
MachInt
i
)
=
hashInteger
i
hashLiteral
(
MachInt64
i
)
=
hashInteger
i
hashLiteral
(
MachWord
i
)
=
hashInteger
i
hashLiteral
(
MachWord64
i
)
=
hashInteger
i
hashLiteral
(
MachFloat
r
)
=
hashRational
r
hashLiteral
(
MachDouble
r
)
=
hashRational
r
hashLiteral
(
MachLabel
s
_
_
)
=
hashFS
s
hashLiteral
(
LitInteger
i
_
)
=
hashInteger
i
hashRational
::
Rational
->
Int
hashRational
r
=
hashInteger
(
numerator
r
)
hashInteger
::
Integer
->
Int
hashInteger
i
=
1
+
abs
(
fromInteger
(
i
`
rem
`
10000
))
-- The 1+ is to avoid zero, which is a Bad Number
-- since we use * to combine hash values
hashFS
::
FastString
->
Int
hashFS
s
=
uniqueOfFS
s
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment