X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmLint.hs;h=83444e5d63e59756ee107efa5c6ac03f03a3ef59;hb=f38d627162c08a598ab07a1f3dcc2ee39ca0936c;hp=fbfb14c1653d42d9bdaa941c3650ede3f028e9bd;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;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