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
fb218a78
Commit
fb218a78
authored
Jul 05, 2010
by
dterei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LLVM: Add in literal undefined value to binding
parent
206149f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
compiler/llvmGen/Llvm/Types.hs
compiler/llvmGen/Llvm/Types.hs
+4
-0
No files found.
compiler/llvmGen/Llvm/Types.hs
View file @
fb218a78
...
...
@@ -101,6 +101,8 @@ data LlvmLit
|
LMFloatLit
Double
LlvmType
-- | Literal NULL, only applicable to pointer types
|
LMNullLit
LlvmType
-- | Undefined value, random bit pattern. Useful for optimisations.
|
LMUndefLit
LlvmType
deriving
(
Eq
)
instance
Show
LlvmLit
where
...
...
@@ -208,6 +210,7 @@ getLit (LMFloatLit r LMFloat ) = fToStr $ realToFrac r
getLit
(
LMFloatLit
r
LMDouble
)
=
dToStr
r
getLit
f
@
(
LMFloatLit
_
_
)
=
error
$
"Can't print this float literal!"
++
show
f
getLit
(
LMNullLit
_
)
=
"null"
getLit
(
LMUndefLit
_
)
=
"undef"
-- | Return the 'LlvmType' of the 'LlvmVar'
getVarType
::
LlvmVar
->
LlvmType
...
...
@@ -221,6 +224,7 @@ getLitType :: LlvmLit -> LlvmType
getLitType
(
LMIntLit
_
t
)
=
t
getLitType
(
LMFloatLit
_
t
)
=
t
getLitType
(
LMNullLit
t
)
=
t
getLitType
(
LMUndefLit
t
)
=
t
-- | Return the 'LlvmType' of the 'LlvmStatic'
getStatType
::
LlvmStatic
->
LlvmType
...
...
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