From 5a10e94c6a791259a0f3d18e4837098b412fbf8a Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 28 Jan 2009 15:48:08 +0000 Subject: [PATCH] Fixed various conflicts between the Polyplate branch and the latest changes in the trunk --- Makefile.am | 6 ++++++ backends/GenerateCHP.hs | 8 +++++--- frontends/OccamTypes.hs | 7 ++----- pass/Pass.hs | 7 +++++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4b5fed3..e3b1ba4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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. diff --git a/backends/GenerateCHP.hs b/backends/GenerateCHP.hs index ad747eb..be7078a 100644 --- a/backends/GenerateCHP.hs +++ b/backends/GenerateCHP.hs @@ -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. diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index 4f8b12a..adffede 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -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 diff --git a/pass/Pass.hs b/pass/Pass.hs index 1cebbda..58bc81e 100644 --- a/pass/Pass.hs +++ b/pass/Pass.hs @@ -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.