From c499e901a25eb7df0bfac03d57ee3401ad6cb7e7 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 5 Mar 2010 18:15:49 +0100 Subject: [PATCH] Let getNormalized return Nothing on non-normalizeable functions. --- "c\316\273ash/CLasH/Normalize.hs" | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index fa14ef6..82cc89b 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -734,20 +734,21 @@ getNormalized :: 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 --- 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 - if Maybe.isNothing expr_maybe + normalizeable <- isNormalizeable' bndr + if not normalizeable || Maybe.isNothing expr_maybe then - -- Binder not found + -- Binder not normalizeable or not found return Nothing else if is_poly (Var bndr) then -- 2.30.2