Ensure no statements after CmmReturn are emitted
[ghc-hetmet.git] / compiler / codeGen / CgMonad.lhs
index e3c8a77..b96db80 100644 (file)
@@ -79,6 +79,7 @@ import FastString
 import Outputable
 
 import Control.Monad
+import Data.List
 
 infixr 9 `thenC`       -- Right-associative!
 infixr 9 `thenFC`
@@ -246,6 +247,7 @@ flattenCgStmts id stmts =
 isJump (CmmJump _ _) = True
 isJump (CmmBranch _) = True
 isJump (CmmSwitch _ _) = True
+isJump (CmmReturn _) = True
 isJump _ = False
 
 isOrdinaryStmt (CgStmt _) = True
@@ -745,7 +747,7 @@ emitSimpleProc :: CLabel -> Code -> Code
 emitSimpleProc lbl code
   = do { stmts <- getCgStmts code
        ; blks <- cgStmtsToBlocks stmts
-       ; emitProc CmmNonInfo lbl [] blks }
+       ; emitProc (CmmInfo Nothing Nothing CmmNonInfoTable) lbl [] blks }
 
 getCmm :: Code -> FCode Cmm
 -- Get all the CmmTops (there should be no stmts)