Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
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
Shayne Fletcher
Glasgow Haskell Compiler
Commits
1ba30eae
Commit
1ba30eae
authored
Dec 29, 2008
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings in CmmUtils
parent
e19c29b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
compiler/cmm/CmmUtils.hs
compiler/cmm/CmmUtils.hs
+5
-11
No files found.
compiler/cmm/CmmUtils.hs
View file @
1ba30eae
{-# OPTIONS -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
-----------------------------------------------------------------------------
--
-- Cmm utilities.
...
...
@@ -114,18 +107,18 @@ isNopStmt :: CmmStmt -> Bool
isNopStmt
CmmNop
=
True
isNopStmt
(
CmmAssign
r
e
)
=
cheapEqReg
r
e
isNopStmt
(
CmmStore
e1
(
CmmLoad
e2
_
))
=
cheapEqExpr
e1
e2
isNopStmt
s
=
False
isNopStmt
_
=
False
cheapEqExpr
::
CmmExpr
->
CmmExpr
->
Bool
cheapEqExpr
(
CmmReg
r
)
e
=
cheapEqReg
r
e
cheapEqExpr
(
CmmRegOff
r
0
)
e
=
cheapEqReg
r
e
cheapEqExpr
(
CmmRegOff
r
n
)
(
CmmRegOff
r'
n'
)
=
r
==
r'
&&
n
==
n'
cheapEqExpr
e1
e2
=
False
cheapEqExpr
_
_
=
False
cheapEqReg
::
CmmReg
->
CmmExpr
->
Bool
cheapEqReg
r
(
CmmReg
r'
)
=
r
==
r'
cheapEqReg
r
(
CmmRegOff
r'
0
)
=
r
==
r'
cheapEqReg
r
e
=
False
cheapEqReg
_
_
=
False
---------------------------------------------------
--
...
...
@@ -139,6 +132,7 @@ isTrivialCmmExpr (CmmMachOp _ _) = False
isTrivialCmmExpr
(
CmmLit
_
)
=
True
isTrivialCmmExpr
(
CmmReg
_
)
=
True
isTrivialCmmExpr
(
CmmRegOff
_
_
)
=
True
isTrivialCmmExpr
(
CmmStackSlot
_
_
)
=
panic
"isTrivialCmmExpr CmmStackSlot"
hasNoGlobalRegs
::
CmmExpr
->
Bool
hasNoGlobalRegs
(
CmmLoad
e
_
)
=
hasNoGlobalRegs
e
...
...
@@ -187,7 +181,7 @@ cmmOffsetLit :: CmmLit -> Int -> CmmLit
cmmOffsetLit
(
CmmLabel
l
)
byte_off
=
cmmLabelOff
l
byte_off
cmmOffsetLit
(
CmmLabelOff
l
m
)
byte_off
=
cmmLabelOff
l
(
m
+
byte_off
)
cmmOffsetLit
(
CmmInt
m
rep
)
byte_off
=
CmmInt
(
m
+
fromIntegral
byte_off
)
rep
cmmOffsetLit
other
byte_off
=
pprPanic
"cmmOffsetLit"
(
ppr
byte_off
)
cmmOffsetLit
_
byte_off
=
pprPanic
"cmmOffsetLit"
(
ppr
byte_off
)
cmmLabelOff
::
CLabel
->
Int
->
CmmLit
-- Smart constructor for CmmLabelOff
...
...
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