summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-12-29 13:26:37 +0000
committerIan Lynagh <igloo@earth.li>2008-12-29 13:26:37 +0000
commit1ba30eaede4836dff7742c574d2a6433c7b0f92c (patch)
treef3c9bafebaea3b6aeba2d3015fb0e7fd861609de /compiler/cmm
parente19c29b97e0d338a4a424a478e2c6c5706589fe9 (diff)
downloadhaskell-1ba30eaede4836dff7742c574d2a6433c7b0f92c.tar.gz
Fix warnings in CmmUtils
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CmmUtils.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/compiler/cmm/CmmUtils.hs b/compiler/cmm/CmmUtils.hs
index 3057712a3a..e01d8f5cba 100644
--- a/compiler/cmm/CmmUtils.hs
+++ b/compiler/cmm/CmmUtils.hs
@@ -1,10 +1,3 @@
-{-# 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