Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track index bounds in the types of Ivory procs #14

Merged
merged 4 commits into from
Oct 13, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comments after return aren't dead code
  • Loading branch information
gridaphobe committed Oct 3, 2014
commit a3371b7bb6e118172524ceee35102d61441c48d9
5 changes: 4 additions & 1 deletion ivory-opts/src/Ivory/Opts/TypeCheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ tyChk ty stmts = void (tyChk' (False, False) stmts)
where
tyChk' :: (SubBlk, Ret) -> [I.Stmt] -> TCResults Ret
-- Ret and no other statemnts
tyChk' (_, True) []
tyChk' (_, True) ss | all isComment ss
= return True
-- Ret and other statements
tyChk' (sb, True) ss
Expand Down Expand Up @@ -152,5 +152,8 @@ tyChk ty stmts = void (tyChk' (False, False) stmts)
tyChk' b (_:ss)
= tyChk' b ss

isComment (I.Comment _) = True
isComment _ = False

xor :: Bool -> Bool -> Bool
xor a b = (not a && b) || (a && not b)