Realised that my optimisation for the usage checking had the condition the wrong way round

This explains why all the usage tests began to fail...
This commit is contained in:
Neil Brown 2009-04-17 19:27:41 +00:00
parent 026eb737b6
commit 4ecc8077ce

View File

@ -100,10 +100,11 @@ findRepSolutions reps bks
-- for any overlapping array indices.
checkArrayUsage :: forall m. (Die m, CSMR m, MonadIO m) => NameAttr -> (Meta, ParItems (BK, UsageLabel)) -> m ()
checkArrayUsage sharedAttr (m,p)
= do debug $ "checkArrayUsage: " ++ show m
indexes <- groupArrayIndexes $ fmap (transformPair id nodeVars) p
mapM_ (checkIndexes m) $ Map.toList $ Map.filter
((<= 1) . length . map (\(_,w,r) -> w++r) . F.toList) indexes
= do indexes <- groupArrayIndexes $ fmap (transformPair id nodeVars) p
let filteredIndexes = Map.toList $ Map.filter
((>= 1) . length . map (\(_,w,r) -> w++r) . F.toList) indexes
debug $ "checkArrayUsage: " ++ show m ++ ", " ++ show (length filteredIndexes)
mapM_ (checkIndexes m) filteredIndexes
where
getDecl :: UsageLabel -> Maybe String
getDecl = join . fmap getScopeIn . nodeDecl