projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split off selector case creation code into CoreTools.
[matthijs/master-project/cλash.git]
/
cλash
/
CLasH
/
Normalize.hs
diff --git
a/cλash/CLasH/Normalize.hs
b/cλash/CLasH/Normalize.hs
index 620482f703547f65f3dff7eb888742f70e67421d..8bc2ef0447bea16a77f70b6fa62651cc93e9d4cf 100644
(file)
--- a/
cλash/CLasH/Normalize.hs
+++ b/
cλash/CLasH/Normalize.hs
@@
-569,12
+569,9
@@
casesimpl c expr@(Case scrut bndr ty alts) | not bndr_used = do
-- inlinenonrep).
if (not wild) && repr
then do
-- inlinenonrep).
if (not wild) && repr
then do
- -- Create on new binder that will actually capture a value in this
+ caseexpr <- Trans.lift $ mkSelCase scrut i
+ -- Create a new binder that will actually capture a value in this
-- case statement, and return it.
-- case statement, and return it.
- let bty = (Id.idType b)
- id <- Trans.lift $ mkInternalVar "sel" bty
- let binders = take i wildbndrs ++ [id] ++ drop (i+1) wildbndrs
- let caseexpr = Case scrut b bty [(con, binders, Var id)]
return (wildbndrs!!i, Just (b, caseexpr))
else
-- Just leave the original binder in place, and don't generate an
return (wildbndrs!!i, Just (b, caseexpr))
else
-- Just leave the original binder in place, and don't generate an