Stopped the pass that removes unused variables removing unused replicators

This commit is contained in:
Neil Brown 2009-01-23 14:24:44 +00:00
parent 732080557c
commit 15a4a59bcf
2 changed files with 4 additions and 2 deletions

View File

@ -303,7 +303,9 @@ checkUnusedVar = forAnyASTStructBottomUpAccum doSpec
where
doSpec :: Data a => A.Structured a -> CheckOptASTM' [A.Name] (A.Structured a) ()
-- Don't touch PROCs, for now:
doSpec (A.Spec _ (A.Specification mspec name (A.Proc {})) scope) = return ()
doSpec (A.Spec _ (A.Specification mspec name (A.Proc {})) scope) = return ()
-- DO NOT remove unused replicators!
doSpec (A.Spec _ (A.Specification mspec name (A.Rep {})) scope) = return ()
doSpec (A.Spec _ (A.Specification mspec name _) scope)
= do -- We can't remove _sizes arrays because the backend uses them for bounds
-- checks that are not explicit in the AST. We'll have to move the

View File

@ -160,7 +160,7 @@ expandArrayLiterals = pass "Expand array literals"
--
-- TODO for simplification, we could avoid pulling up replication counts that are known to be constants
pullRepCounts :: Pass
pullRepCounts = pass "Pull up replicator counts for SEQs"
pullRepCounts = pass "Pull up replicator counts for SEQs, PARs and ALTs"
(Prop.agg_namesDone ++ Prop.agg_typesDone)
[]
(applyDepthM2