[project @ 2005-05-21 15:39:00 by panne]
authorpanne <unknown>
Sat, 21 May 2005 15:39:00 +0000 (15:39 +0000)
committerpanne <unknown>
Sat, 21 May 2005 15:39:00 +0000 (15:39 +0000)
Warning police: Removed overlapped patterns. In general, taking
compiler warnings about unmatched patterns seriously when they come up
later might be better than writing catch-all patterns right from the
start. Otherwise readers are confused and wonder which patterns might
be missing when there are none.

ghc/compiler/cmm/PprC.hs
ghc/compiler/cmm/PprCmm.hs
ghc/compiler/nativeGen/MachCodeGen.hs

index f2c607b..72a3cb1 100644 (file)
@@ -738,9 +738,10 @@ pprGlobalRegName gr = case gr of
     VanillaReg n   -> char 'R' <> int n  -- without the .w suffix
     _              -> pprGlobalReg gr
 
+-- Currently we only have these two calling conventions, but this might
+-- change in the future...
 is_cish CCallConv   = True
 is_cish StdCallConv = True
-is_cish _          = False
 
 -- ---------------------------------------------------------------------
 -- Find and print local and external declarations for a list of
@@ -822,11 +823,10 @@ te_Stmt _                 = return ()
 
 te_Expr :: CmmExpr -> TE ()
 te_Expr (CmmLit lit)           = te_Lit lit
-te_Expr (CmmReg r)             = te_Reg r
 te_Expr (CmmLoad e _)          = te_Expr e
+te_Expr (CmmReg r)             = te_Reg r
 te_Expr (CmmMachOp _ es)       = mapM_ te_Expr es
 te_Expr (CmmRegOff r _)        = te_Reg r
-te_Expr _                      = return ()
 
 te_Reg :: CmmReg -> TE ()
 te_Reg (CmmLocal l) = te_temp l
index f38eb30..3c3e976 100644 (file)
@@ -317,7 +317,6 @@ pprExpr9 e =
         CmmReg    reg       -> ppr reg
         CmmRegOff reg off   -> parens (ppr reg <+> char '+' <+> int off)
        CmmMachOp mop args  -> genMachOp mop args
-       e                   -> parens (pprExpr e)
 
 genMachOp :: MachOp -> [CmmExpr] -> SDoc
 genMachOp mop args
@@ -351,7 +350,6 @@ infixMachOp mop
             MO_Xor    _ -> Just $ char '^'
             MO_Not    _ -> Just $ char '~'
             MO_S_Neg  _ -> Just $ char '-' -- there is no unsigned neg :)
-           MO_Not    _ -> Just $ char '~'
             _ -> Nothing
 
 -- --------------------------------------------------------------------------
@@ -434,8 +432,6 @@ pprGlobalReg gr
         BaseReg        -> ptext SLIT("BaseReg")
         PicBaseReg     -> ptext SLIT("PicBaseReg")
 
-        _ -> panic $ "PprCmm.pprGlobalReg: unknown global reg"
-
 -- --------------------------------------------------------------------------
 -- data sections
 --
index 26e86f3..24e8b04 100644 (file)
@@ -3255,8 +3255,6 @@ outOfLineFloatOp mop res args vols
              MO_F64_Tanh  -> FSLIT("tanh")
              MO_F64_Pwr   -> FSLIT("pow")
 
-              other -> pprPanic "outOfLineFloatOp" (pprCallishMachOp mop)
-
 #endif /* i386_TARGET_ARCH || x86_64_TARGET_ARCH */
 
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -