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:
7eed9f7
)
Let getNormalized return Nothing on non-normalizeable functions.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Fri, 5 Mar 2010 17:15:49 +0000
(18:15 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Fri, 5 Mar 2010 17:15:49 +0000
(18:15 +0100)
cλash/CLasH/Normalize.hs
patch
|
blob
|
history
diff --git
a/cλash/CLasH/Normalize.hs
b/cλash/CLasH/Normalize.hs
index fa14ef65ef7dec1b818e73f86c3da4fdb5842028..82cc89b3c0b5f80f0299a002f0cee42e9a755b23 100644
(file)
--- a/
cλash/CLasH/Normalize.hs
+++ b/
cλash/CLasH/Normalize.hs
@@
-734,20
+734,21
@@
getNormalized ::
getNormalized bndr = do
norm <- getNormalized_maybe bndr
return $ Maybe.fromMaybe
getNormalized bndr = do
norm <- getNormalized_maybe bndr
return $ Maybe.fromMaybe
- (error $ "Normalize.getNormalized: Unknown function requested: " ++ show bndr)
+ (error $ "Normalize.getNormalized: Unknown
or non-representable
function requested: " ++ show bndr)
norm
-- | Returns the normalized version of the given function, or Nothing
norm
-- | Returns the normalized version of the given function, or Nothing
--- when the binder is not a known global binder.
+-- when the binder is not a known global binder
or is not normalizeable
.
getNormalized_maybe ::
CoreBndr -- ^ The function to get
-> TranslatorSession (Maybe CoreExpr) -- The normalized function body
getNormalized_maybe bndr = do
expr_maybe <- getGlobalBind bndr
getNormalized_maybe ::
CoreBndr -- ^ The function to get
-> TranslatorSession (Maybe CoreExpr) -- The normalized function body
getNormalized_maybe bndr = do
expr_maybe <- getGlobalBind bndr
- if Maybe.isNothing expr_maybe
+ normalizeable <- isNormalizeable' bndr
+ if not normalizeable || Maybe.isNothing expr_maybe
then
then
- -- Binder not found
+ -- Binder not
normalizeable or not
found
return Nothing
else if is_poly (Var bndr)
then
return Nothing
else if is_poly (Var bndr)
then