Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ba40c982
Commit
ba40c982
authored
Jun 20, 2006
by
Simon Marlow
Browse files
check that the argument to CmmCondBranch is really a conditional
parent
ea16a2e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/cmm/CmmLint.hs
View file @
ba40c982
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment