Added a preliminary pass-list for the work on flattening arrays
This commit is contained in:
parent
a2106a98e7
commit
60c7a2dde3
|
@ -28,9 +28,21 @@ import qualified AST as A
|
|||
import CompState
|
||||
import Metadata
|
||||
import Pass
|
||||
import qualified Properties as Prop
|
||||
import Types
|
||||
import Utils
|
||||
|
||||
squashArrays :: [Pass]
|
||||
squashArrays = makePassesDep
|
||||
[ ("Declare array-size arrays", declareSizesArray, prereq, [])
|
||||
, ("Add array-size arrays to PROC headers", addSizesFormalParameters, prereq, [])
|
||||
, ("Add array-size arrays to PROC calls", addSizesActualParameters, prereq, [])
|
||||
]
|
||||
where
|
||||
prereq = Prop.agg_namesDone ++ Prop.agg_typesDone ++ Prop.agg_functionsGone ++ [Prop.subscriptsPulledUp, Prop.arrayLiteralsExpanded]
|
||||
|
||||
-- Prop.subscriptsPulledUp
|
||||
|
||||
-- | Identify processes that we'll need to compute the stack size of.
|
||||
identifyParProcs :: Data t => t -> PassM t
|
||||
identifyParProcs = doGeneric `extM` doProcess
|
||||
|
@ -85,9 +97,6 @@ append_sizes n = n {A.nameName = A.nameName n ++ "_sizes"}
|
|||
|
||||
-- | Declares a _sizes array for every array, statically sized or dynamically sized.
|
||||
-- For each record type it declares a _sizes array too.
|
||||
|
||||
-- TODO must make sure that each expression is already pulled out into a variable
|
||||
|
||||
declareSizesArray :: Data t => t -> PassM t
|
||||
declareSizesArray = doGeneric `ext1M` doStructured
|
||||
where
|
||||
|
|
|
@ -18,6 +18,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
module Properties
|
||||
( agg_namesDone
|
||||
, agg_functionsGone
|
||||
, agg_typesDone
|
||||
, afterRemoved
|
||||
, allChansToAnyOrProtocol
|
||||
|
@ -79,6 +80,9 @@ agg_namesDone = [declarationsUnique, declarationTypesRecorded, inferredTypesReco
|
|||
agg_typesDone :: [Property]
|
||||
agg_typesDone = [expressionTypesChecked, inferredTypesRecorded, processTypesChecked, typesResolvedInAST, typesResolvedInState]
|
||||
|
||||
agg_functionsGone :: [Property]
|
||||
agg_functionsGone = [functionCallsRemoved, functionsRemoved]
|
||||
|
||||
-- Mark out all the checks I still need to implement:
|
||||
checkTODO :: Monad m => A.AST -> m ()
|
||||
checkTODO _ = return ()
|
||||
|
|
Loading…
Reference in New Issue
Block a user