Fix unused results handling
commitcf40fd55dea57d0bf3262c034566b44a303850ae
authorAndy Arvanitis <andyarvanitis@gmail.com>
dateTue 9 Jul 2019, 21:26 (7 years ago)
parent9819f6c
src/CodeGen/IL/Optimizer.hs+1−1
@@ -66,5 +66,5 @@ ignoreUnusedResults = everywhere $ removeFromBlock go
6666 go :: [AST] -> [AST]
6767 go [] = []
6868 go (VariableIntroduction ss var s@(Just _) : sts)
69− | not $ any (everything (||) (isUsed var)) sts = (VariableIntroduction ss unusedName s) : sts
69+ | not $ any (everything (||) (isUsed var)) sts = (VariableIntroduction ss unusedName s) : (go sts)
7070 go (s:sts) = s : go sts