From e1cd694c27d3340891767249ebdb3a610f92464d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 31 Mar 2009 09:22:59 +0000 Subject: [PATCH] Added code to pull up any VariableSizes expressions (since they result in an array) --- transformations/SimplifyExprs.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index 812bd77..00dc1bc 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -490,7 +490,12 @@ pullUp pullUpArraysInsideRecords = pass "Pull up definitions" addPulled $ (m, Left spec) return $ A.Variable m n _ -> descend v - + doVariable v@(A.VariableSizes m _) + = do v' <- descend v + t <- astTypeOf v' + spec@(A.Specification _ n _) <- makeNonceIs "sizes_array" m t A.ValAbbrev v' + addPulled $ (m, Left spec) + return $ A.Variable m n doVariable v = descend v -- | Convert a FUNCTION call into some variables and a PROC call.