Fixed various conflicts between the Polyplate branch and the latest changes in the trunk

This commit is contained in:
Neil Brown 2009-01-28 15:48:08 +00:00
parent 3950a6360d
commit 5a10e94c6a
4 changed files with 18 additions and 10 deletions

View File

@ -258,6 +258,12 @@ pkginclude_HEADERS += support/tock_intrinsics_float.h
clean-local:
rm -f obj/*.o obj/*.hi
[ ! -d obj ] || rmdir obj
rm -f obj/Data/Generics/*.o obj/Data/Generics/*.hi
rm -f obj/Data/Generics/Polyplate/*.o obj/Data/Generics/Polyplate/*.hi
rmdir obj/Data/Generics/Polyplate
rmdir obj/Data/Generics
rmdir obj/Data
rmdir obj
# We post-process the Haddock output with M4 so that we can include SVG images.

View File

@ -245,14 +245,16 @@ genType A.Real32 = tell ["Float"]
genType A.Real64 = tell ["Double"]
genType (A.Array _ t) = tell ["(IOUArray Int32 "] >> genType t >> tell [")"]
genType (A.List t) = tell["(Seq "] >> genType t >> tell [")"]
genType (A.Chan dir attr inner)
genType (A.ChanEnd dir attr inner)
= do tell ["(", case dir of
A.DirInput -> "Chanin"
A.DirOutput -> "Chanout"
A.DirUnknown -> "One2OneChannel"]
A.DirOutput -> "Chanout"]
tell ["(IOUArray Word8)"]
-- genType inner
tell [")"]
genType (A.Chan attr inner)
= do tell ["(One2OneChannel (IOUArray Word8))"]
-- genType inner
genType _ = genMissing "genType"
--TODO compile IFs into case. And case into case.

View File

@ -1000,18 +1000,15 @@ inferTypes = occamOnlyPass "Infer types"
return $ A.Only m el'
findDir :: Data a => A.Name -> a -> PassM [A.Direction]
findDir n = flip execStateT [] . makeRecurse ops
findDir n = flip execStateT [] . makeRecurseM ops
where
ops = baseOp `extOp` doVariable
ops = baseOp `extOpM` doVariable
-- This will cover everything, since we will have inferred the direction
-- specifiers before applying this function.
doVariable :: A.Variable -> StateT [A.Direction] PassM A.Variable
doVariable v@(A.DirectedVariable _ dir (A.Variable _ n')) | n == n'
= modify (dir:) >> return v
doVariable v@(A.DirectedVariable _ dir
(A.SubscriptedVariable _ _ (A.Variable _ n'))) | n == n'
= modify (dir:) >> return v
doVariable v = makeDescend ops v

View File

@ -136,7 +136,7 @@ rainOnlyPass = passMakerHelper $ (== FrontendRain) . csFrontend
occamOnlyPass :: PassMaker t
occamOnlyPass = passMakerHelper $ (== FrontendOccam) . csFrontend
occamAndCOnlyPass :: PassMaker
occamAndCOnlyPass :: PassMaker t
occamAndCOnlyPass = passMakerHelper $
\st -> (csFrontend st == FrontendOccam) && (csBackend st == BackendC)
@ -146,7 +146,10 @@ cOnlyPass = passMakerHelper $ (== BackendC) . csBackend
cppOnlyPass :: PassMaker t
cppOnlyPass = passMakerHelper $ (== BackendCPPCSP) . csBackend
pass :: PassMaker
cOrCppOnlyPass :: PassMaker t
cOrCppOnlyPass = passMakerHelper $ (`elem` [BackendC, BackendCPPCSP]) . csBackend
pass :: PassMaker t
pass = passMakerHelper (const True)
-- | Compose a list of passes into a single pass by running them in the order given.