Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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
-- ** Operations on Literals
,
literalType
,
hashLiteral
,
absentLiteralOf
,
pprLiteral
...
...
@@ -58,7 +57,6 @@ import Util
import
Data.ByteString
(
ByteString
)
import
Data.Int
import
Data.Ratio
import
Data.Word
import
Data.Char
import
Data.Data
(
Data
)
...
...
@@ -500,38 +498,3 @@ MachDouble -1.0##
LitInteger -1 (-1)
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