Added support for mobile types to the genType functions in the C and C++ backends

This commit is contained in:
Neil Brown 2007-10-21 14:37:05 +00:00
parent 86054ba754
commit 9f78582391
2 changed files with 5 additions and 0 deletions

View File

@ -395,6 +395,9 @@ cgenType ops (A.Array _ t)
_ -> return ()
tell ["*"]
cgenType _ (A.Record n) = genName n
cgenType ops (A.Mobile t@(A.Array {})) = call genType ops t
cgenType ops (A.Mobile t) = call genType ops t >> tell ["*"]
-- UserProtocol -- not used
-- Channels are of type "Channel", but channel-ends are of type "Channel*"
cgenType _ (A.Chan A.DirUnknown _ t) = tell ["Channel"]

View File

@ -907,6 +907,8 @@ cppgenType ops (A.Chan dir attr t)
tell $ intersperse "*" [case d of A.Dimension n -> show n | d <- ds]
tell [">/**/"]
cppTypeInsideChannel ops t = call genType ops t
cppgenType ops (A.Mobile t@(A.Array {})) = call genType ops t
cppgenType ops (A.Mobile t) = call genType ops t >> tell ["*"]
cppgenType ops t
= case call getScalarType ops t of
Just s -> tell [s]