Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make lint check for undefined variables in Cmm

  • Loading branch information...
commit b534f42bca1d28b957f70e92ef7698034e537d6e 1 parent 0b75e45
@simonmar simonmar authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 compiler/cmm/CmmLint.hs
View
6 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)
Please sign in to comment.
Something went wrong with that request. Please try again.