summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-08-06 15:29:20 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-08-07 15:30:35 +0100
commitb534f42bca1d28b957f70e92ef7698034e537d6e (patch)
treeba153359c126891ab2a9ffaa08e8c7496646380b
parent0b75e456b62c9d36e6ce9756278a36db9e1baaaa (diff)
downloadhaskell-b534f42bca1d28b957f70e92ef7698034e537d6e.tar.gz
Make lint check for undefined variables in Cmm
-rw-r--r--compiler/cmm/CmmLint.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/cmm/CmmLint.hs b/compiler/cmm/CmmLint.hs
index 2e24dd7f82..47c30b1a0f 100644
--- a/compiler/cmm/CmmLint.hs
+++ b/compiler/cmm/CmmLint.hs
@@ -13,6 +13,7 @@ module CmmLint (
import Hoopl
import Cmm
import CmmUtils
+import CmmLive
import PprCmm ()
import BlockId
import FastString
@@ -53,7 +54,10 @@ lintCmmDecl (CmmData {})
lintCmmGraph :: CmmGraph -> CmmLint ()
-lintCmmGraph g = mapM_ (lintCmmBlock labels) blocks
+lintCmmGraph g = cmmLiveness g `seq` mapM_ (lintCmmBlock labels) blocks
+ -- cmmLiveness throws an error if there are registers
+ -- live on entry to the graph (i.e. undefined
+ -- variables)
where
blocks = toBlockList g
labels = setFromList (map entryLabel blocks)