Fixed the support in the backends for mobile channel stuff
This commit is contained in:
parent
ca61da25cf
commit
8e5e73e3a2
|
@ -1073,6 +1073,12 @@ cgenInputItem c (A.InVariable m v)
|
||||||
tell [","]
|
tell [","]
|
||||||
rhs
|
rhs
|
||||||
tell [");"]
|
tell [");"]
|
||||||
|
A.Mobile {} ->
|
||||||
|
do tell ["MTChanIn(wptr,"]
|
||||||
|
call genVariable c
|
||||||
|
tell [",(void*)"]
|
||||||
|
rhs
|
||||||
|
tell [");"]
|
||||||
_ ->
|
_ ->
|
||||||
do tell ["ChanIn(wptr,"]
|
do tell ["ChanIn(wptr,"]
|
||||||
call genVariable c
|
call genVariable c
|
||||||
|
@ -1099,21 +1105,37 @@ cgenOutputItem c (A.OutCounted m ce ae)
|
||||||
call genBytesIn m subT (Right v)
|
call genBytesIn m subT (Right v)
|
||||||
tell [");"]
|
tell [");"]
|
||||||
cgenOutputItem c (A.OutExpression m e)
|
cgenOutputItem c (A.OutExpression m e)
|
||||||
= do t <- astTypeOf e
|
= do t <- astTypeOf c
|
||||||
case (t, e) of
|
let innerT = case t of
|
||||||
|
A.Chan _ t' -> t'
|
||||||
|
A.ChanEnd _ _ t' -> t'
|
||||||
|
case (innerT, e) of
|
||||||
(A.Int, _) ->
|
(A.Int, _) ->
|
||||||
do tell ["ChanOutInt(wptr,"]
|
do tell ["ChanOutInt(wptr,"]
|
||||||
call genVariable c
|
call genVariable c
|
||||||
tell [","]
|
tell [","]
|
||||||
call genExpression e
|
call genExpression e
|
||||||
tell [");"]
|
tell [");"]
|
||||||
|
(A.Mobile {}, A.ExprVariable _ (A.DerefVariable _ v)) ->
|
||||||
|
do tell ["{void* outtmp = MTClone(*"]
|
||||||
|
call genVariableAM v A.Abbrev
|
||||||
|
tell [");MTChanOut(wptr,"]
|
||||||
|
call genVariable c
|
||||||
|
tell [",&outtmp);}"]
|
||||||
|
(A.Mobile {}, A.ExprVariable _ v) ->
|
||||||
|
do tell ["MTChanOut(wptr,"]
|
||||||
|
call genVariable c
|
||||||
|
tell [",(void*)"]
|
||||||
|
call genVariableAM v A.Abbrev
|
||||||
|
tell [");"]
|
||||||
(_, A.ExprVariable _ v) ->
|
(_, A.ExprVariable _ v) ->
|
||||||
do tell ["ChanOut(wptr,"]
|
do tell ["ChanOut(wptr,"]
|
||||||
call genVariable c
|
call genVariable c
|
||||||
tell [","]
|
tell [","]
|
||||||
call genVariableAM v A.Abbrev
|
call genVariableAM v A.Abbrev
|
||||||
tell [","]
|
tell [","]
|
||||||
call genBytesIn m t (Right v)
|
te <- astTypeOf e
|
||||||
|
call genBytesIn m te (Right v)
|
||||||
tell [");"]
|
tell [");"]
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ evalVariable (A.Variable m n)
|
||||||
Nothing -> throwError (Just m, "non-constant variable " ++ show n ++ " used")
|
Nothing -> throwError (Just m, "non-constant variable " ++ show n ++ " used")
|
||||||
evalVariable (A.SubscriptedVariable _ sub v) = evalVariable v >>= evalSubscript sub
|
evalVariable (A.SubscriptedVariable _ sub v) = evalVariable v >>= evalSubscript sub
|
||||||
evalVariable (A.DirectedVariable _ _ v) = evalVariable v
|
evalVariable (A.DirectedVariable _ _ v) = evalVariable v
|
||||||
|
evalVariable (A.DerefVariable _ v) = evalVariable v
|
||||||
|
|
||||||
evalIndex :: A.Expression -> EvalM Int
|
evalIndex :: A.Expression -> EvalM Int
|
||||||
evalIndex e
|
evalIndex e
|
||||||
|
|
Loading…
Reference in New Issue
Block a user