Fixed the occam pass list so that it now has the correct order in respect to all the pre-requisite properties
This commit is contained in:
parent
15cf63980f
commit
4537cd205c
|
@ -35,11 +35,11 @@ import Utils
|
||||||
|
|
||||||
squashArrays :: [Pass]
|
squashArrays :: [Pass]
|
||||||
squashArrays = makePassesDep
|
squashArrays = makePassesDep
|
||||||
[ ("Declare array-size arrays", declareSizesArray, prereq ++ [Prop.slicesSimplified,
|
[ ("Simplify array slices", simplifySlices, prereq, [Prop.slicesSimplified])
|
||||||
|
, ("Declare array-size arrays", declareSizesArray, prereq ++ [Prop.slicesSimplified,
|
||||||
Prop.arrayConstructorsRemoved], [Prop.arraySizesDeclared])
|
Prop.arrayConstructorsRemoved], [Prop.arraySizesDeclared])
|
||||||
, ("Add array-size arrays to PROC headers", addSizesFormalParameters, prereq ++ [Prop.arraySizesDeclared], [])
|
, ("Add array-size arrays to PROC headers", addSizesFormalParameters, prereq ++ [Prop.arraySizesDeclared], [])
|
||||||
, ("Add array-size arrays to PROC calls", addSizesActualParameters, prereq ++ [Prop.arraySizesDeclared], [])
|
, ("Add array-size arrays to PROC calls", addSizesActualParameters, prereq ++ [Prop.arraySizesDeclared], [])
|
||||||
, ("Simplify array slices", simplifySlices, prereq, [Prop.slicesSimplified])
|
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
prereq = Prop.agg_namesDone ++ Prop.agg_typesDone ++ Prop.agg_functionsGone ++ [Prop.subscriptsPulledUp, Prop.arrayLiteralsExpanded]
|
prereq = Prop.agg_namesDone ++ Prop.agg_typesDone ++ Prop.agg_functionsGone ++ [Prop.subscriptsPulledUp, Prop.arrayLiteralsExpanded]
|
||||||
|
|
|
@ -37,7 +37,13 @@ import Types
|
||||||
-- | Occam-specific frontend passes.
|
-- | Occam-specific frontend passes.
|
||||||
occamPasses :: [Pass]
|
occamPasses :: [Pass]
|
||||||
occamPasses = makePassesDep' ((== FrontendOccam) . csFrontend)
|
occamPasses = makePassesDep' ((== FrontendOccam) . csFrontend)
|
||||||
[ ("Fold constants", foldConstants,
|
[ ("Dummy occam pass", dummyOccamPass,
|
||||||
|
[],
|
||||||
|
Prop.agg_namesDone ++ [Prop.mainTagged])
|
||||||
|
, ("Infer types", inferTypes,
|
||||||
|
[],
|
||||||
|
[Prop.inferredTypesRecorded])
|
||||||
|
, ("Fold constants", foldConstants,
|
||||||
[Prop.inferredTypesRecorded],
|
[Prop.inferredTypesRecorded],
|
||||||
[Prop.constantsFolded])
|
[Prop.constantsFolded])
|
||||||
, ("Fix the types of array constructors", fixConstructorTypes,
|
, ("Fix the types of array constructors", fixConstructorTypes,
|
||||||
|
@ -46,9 +52,6 @@ occamPasses = makePassesDep' ((== FrontendOccam) . csFrontend)
|
||||||
, ("Check mandatory constants", checkConstants,
|
, ("Check mandatory constants", checkConstants,
|
||||||
[Prop.constantsFolded, Prop.arrayConstructorTypesDone],
|
[Prop.constantsFolded, Prop.arrayConstructorTypesDone],
|
||||||
[Prop.constantsChecked])
|
[Prop.constantsChecked])
|
||||||
, ("Infer types", inferTypes,
|
|
||||||
[],
|
|
||||||
[Prop.inferredTypesRecorded])
|
|
||||||
, ("Resolve ambiguities", resolveAmbiguities,
|
, ("Resolve ambiguities", resolveAmbiguities,
|
||||||
[Prop.inferredTypesRecorded],
|
[Prop.inferredTypesRecorded],
|
||||||
[Prop.ambiguitiesResolved])
|
[Prop.ambiguitiesResolved])
|
||||||
|
@ -56,9 +59,6 @@ occamPasses = makePassesDep' ((== FrontendOccam) . csFrontend)
|
||||||
[Prop.inferredTypesRecorded, Prop.ambiguitiesResolved],
|
[Prop.inferredTypesRecorded, Prop.ambiguitiesResolved],
|
||||||
[Prop.expressionTypesChecked, Prop.processTypesChecked,
|
[Prop.expressionTypesChecked, Prop.processTypesChecked,
|
||||||
Prop.functionTypesChecked, Prop.retypesChecked])
|
Prop.functionTypesChecked, Prop.retypesChecked])
|
||||||
, ("Dummy occam pass", dummyOccamPass,
|
|
||||||
[],
|
|
||||||
Prop.agg_namesDone ++ [Prop.mainTagged])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
-- | Fixed the types of array constructors according to the replicator count
|
-- | Fixed the types of array constructors according to the replicator count
|
||||||
|
|
|
@ -47,10 +47,10 @@ commonPasses opts = concat $
|
||||||
, makePassesDep' csUsageChecking [("Usage checking", runPassR usageCheckPass, Prop.agg_namesDone, [Prop.parUsageChecked])]
|
, makePassesDep' csUsageChecking [("Usage checking", runPassR usageCheckPass, Prop.agg_namesDone, [Prop.parUsageChecked])]
|
||||||
-- If usage checking is turned off, the pass list will break unless we insert this dummy item:
|
-- If usage checking is turned off, the pass list will break unless we insert this dummy item:
|
||||||
, makePassesDep' (not . csUsageChecking) [("Usage checking turned OFF", return, Prop.agg_namesDone, [Prop.parUsageChecked])]
|
, makePassesDep' (not . csUsageChecking) [("Usage checking turned OFF", return, Prop.agg_namesDone, [Prop.parUsageChecked])]
|
||||||
|
, simplifyComms
|
||||||
, simplifyExprs
|
, simplifyExprs
|
||||||
, simplifyProcs
|
, simplifyProcs
|
||||||
, unnest
|
, unnest
|
||||||
, simplifyComms
|
|
||||||
, squashArrays
|
, squashArrays
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,10 @@ simplifyExprs = makePassesDep
|
||||||
Prop.functionTypesChecked], [Prop.functionsRemoved])
|
Prop.functionTypesChecked], [Prop.functionsRemoved])
|
||||||
, ("Convert AFTER to MINUS", removeAfter, [Prop.expressionTypesChecked], [Prop.afterRemoved])
|
, ("Convert AFTER to MINUS", removeAfter, [Prop.expressionTypesChecked], [Prop.afterRemoved])
|
||||||
, ("Expand array literals", expandArrayLiterals, [Prop.expressionTypesChecked, Prop.processTypesChecked], [Prop.arrayLiteralsExpanded])
|
, ("Expand array literals", expandArrayLiterals, [Prop.expressionTypesChecked, Prop.processTypesChecked], [Prop.arrayLiteralsExpanded])
|
||||||
, ("Transform array constructors into initialisation code", transformConstr, Prop.agg_namesDone ++ Prop.agg_typesDone
|
|
||||||
++ [Prop.subscriptsPulledUp], [Prop.arrayConstructorsRemoved])
|
|
||||||
, ("Pull up replicator counts for SEQs", pullRepCounts, Prop.agg_namesDone ++ Prop.agg_typesDone, [])
|
, ("Pull up replicator counts for SEQs", pullRepCounts, Prop.agg_namesDone ++ Prop.agg_typesDone, [])
|
||||||
, ("Pull up definitions", pullUp False, Prop.agg_namesDone ++ Prop.agg_typesDone ++ [Prop.functionsRemoved, Prop.seqInputsFlattened], [Prop.functionCallsRemoved, Prop.subscriptsPulledUp])
|
, ("Pull up definitions", pullUp False, Prop.agg_namesDone ++ Prop.agg_typesDone ++ [Prop.functionsRemoved, Prop.seqInputsFlattened], [Prop.functionCallsRemoved, Prop.subscriptsPulledUp])
|
||||||
|
, ("Transform array constructors into initialisation code", transformConstr, Prop.agg_namesDone ++ Prop.agg_typesDone
|
||||||
|
++ [Prop.subscriptsPulledUp], [Prop.arrayConstructorsRemoved])
|
||||||
]
|
]
|
||||||
-- ++ makePassesDep' ((== BackendCPPCSP) . csBackend) [("Pull up definitions (C++)", pullUp True, Prop.agg_namesDone ++ [Prop.expressionTypesChecked, Prop.functionsRemoved, Prop.processTypesChecked,Prop.seqInputsFlattened], [Prop.functionCallsRemoved, Prop.subscriptsPulledUp])]
|
-- ++ makePassesDep' ((== BackendCPPCSP) . csBackend) [("Pull up definitions (C++)", pullUp True, Prop.agg_namesDone ++ [Prop.expressionTypesChecked, Prop.functionsRemoved, Prop.processTypesChecked,Prop.seqInputsFlattened], [Prop.functionCallsRemoved, Prop.subscriptsPulledUp])]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user