From 15a4a59bcf6ae7a83d4074d5c56260f466f4e227 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 23 Jan 2009 14:24:44 +0000 Subject: [PATCH] Stopped the pass that removes unused variables removing unused replicators --- checks/Check.hs | 4 +++- transformations/SimplifyExprs.hs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/checks/Check.hs b/checks/Check.hs index 3742d5f..5ba4579 100644 --- a/checks/Check.hs +++ b/checks/Check.hs @@ -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 diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index 343221f..f258e3e 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -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