projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7c2c7e
)
Let scrutinee binder removal mark the expression as changed.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Mon, 7 Dec 2009 14:11:04 +0000
(15:11 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Mon, 7 Dec 2009 14:11:04 +0000
(15:11 +0100)
cλash/CLasH/Normalize.hs
patch
|
blob
|
history
diff --git
a/cλash/CLasH/Normalize.hs
b/cλash/CLasH/Normalize.hs
index a06094b9927b7b855ad1e703533f5166273227d2..f0f2de2fccba3187092c4958bc1e3382cc0c0682 100644
(file)
--- a/
cλash/CLasH/Normalize.hs
+++ b/
cλash/CLasH/Normalize.hs
@@
-402,7
+402,7
@@
scrutbndrremove, scrutbndrremovetop :: Transform
-- all occurences of the binder with the scrutinee variable.
scrutbndrremove (Case (Var scrut) bndr ty alts) | bndr_used = do
alts' <- mapM subs_bndr alts
-
return
$ Case (Var scrut) wild ty alts'
+
change
$ Case (Var scrut) wild ty alts'
where
is_used (_, _, expr) = expr_uses_binders [bndr] expr
bndr_used = or $ map is_used alts