From: Matthijs Kooijman Date: Thu, 6 Aug 2009 15:32:25 +0000 (+0200) Subject: Fix letremoveunused, it removed all used bindings. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=1208e784cccf1d2d6d290ec1609a64584e8ed555;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Fix letremoveunused, it removed all used bindings. --- diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index b2b4bd8..90cbbc7 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -170,7 +170,7 @@ letremoveunused expr@(Let (Rec binds) res) = do bound_exprs = map snd binds -- For each bind check if the bind is used by res or any of the bound -- expressions - dobind (bndr, _) = not $ any (expr_uses_binders [bndr]) (res:bound_exprs) + dobind (bndr, _) = any (expr_uses_binders [bndr]) (res:bound_exprs) -- Leave all other expressions unchanged letremoveunused expr = return expr letremoveunusedtop = everywhere ("letremoveunused", letremoveunused)