X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmLint.hs;h=83444e5d63e59756ee107efa5c6ac03f03a3ef59;hb=ba40c9828ce8ce18e834af4f832792365d82e319;hp=fbfb14c1653d42d9bdaa941c3650ede3f028e9bd;hpb=ea16a2e5f05ec890679e70ccba13472fccc67db7;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmLint.hs b/compiler/cmm/CmmLint.hs index fbfb14c..83444e5 100644 --- a/compiler/cmm/CmmLint.hs +++ b/compiler/cmm/CmmLint.hs @@ -118,11 +118,15 @@ lintCmmStmt (CmmStore l r) = do lintCmmExpr r return () lintCmmStmt (CmmCall _target _res args _vols) = mapM_ (lintCmmExpr.fst) args -lintCmmStmt (CmmCondBranch e _id) = lintCmmExpr e >> return () +lintCmmStmt (CmmCondBranch e _id) = lintCmmExpr e >> checkCond e >> return () lintCmmStmt (CmmSwitch e _branches) = lintCmmExpr e >> return () lintCmmStmt (CmmJump e _args) = lintCmmExpr e >> return () lintCmmStmt _other = return () +checkCond (CmmMachOp mop _) | isComparisonMachOp mop = return () +checkCond expr = cmmLintErr (hang (text "expression is not a conditional:") 2 + (ppr expr)) + -- ----------------------------------------------------------------------------- -- CmmLint monad