Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
[ghc-hetmet.git] / compiler / codeGen / CgMonad.lhs
index d40c511..6861a2c 100644 (file)
@@ -8,6 +8,13 @@ See the beginning of the top-level @CodeGen@ module, to see how this
 monadic stuff fits into the Big Picture.
 
 \begin{code}
+{-# OPTIONS_GHC -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/WorkingConventions#Warnings
+-- for details
+
 module CgMonad (
        Code,   -- type
        FCode,  -- type
@@ -79,6 +86,7 @@ import FastString
 import Outputable
 
 import Control.Monad
+import Data.List
 
 infixr 9 `thenC`       -- Right-associative!
 infixr 9 `thenFC`
@@ -246,6 +254,7 @@ flattenCgStmts id stmts =
 isJump (CmmJump _ _) = True
 isJump (CmmBranch _) = True
 isJump (CmmSwitch _ _) = True
+isJump (CmmReturn _) = True
 isJump _ = False
 
 isOrdinaryStmt (CgStmt _) = True
@@ -745,7 +754,7 @@ emitSimpleProc :: CLabel -> Code -> Code
 emitSimpleProc lbl code
   = do { stmts <- getCgStmts code
        ; blks <- cgStmtsToBlocks stmts
-       ; emitProc (CmmNonInfo Nothing) lbl [] blks }
+       ; emitProc (CmmInfo Nothing Nothing CmmNonInfoTable) lbl [] blks }
 
 getCmm :: Code -> FCode Cmm
 -- Get all the CmmTops (there should be no stmts)