Fixed the generation of directed channels for the C++ backend
This commit is contained in:
parent
de097bb138
commit
debdef4f4f
|
@ -709,11 +709,12 @@ cgenVariableWithAM checkValid v am fct
|
||||||
, Pointer $ innerCT)
|
, Pointer $ innerCT)
|
||||||
_ -> inner v
|
_ -> inner v
|
||||||
inner wholeV@(A.DirectedVariable m dir v)
|
inner wholeV@(A.DirectedVariable m dir v)
|
||||||
= do (cg, _) <- inner v
|
= do (cg, ctInner) <- inner v
|
||||||
|
let cg' = dressUp m (cg, ctInner) (stripPointers ctInner)
|
||||||
t <- astTypeOf v
|
t <- astTypeOf v
|
||||||
wholeT <- astTypeOf wholeV
|
wholeT <- astTypeOf wholeV
|
||||||
ct <- call getCType m wholeT A.Original
|
ct <- call getCType m wholeT A.Original
|
||||||
return (call genDirectedVariable m t cg dir, ct)
|
return (call genDirectedVariable m t cg' dir, ct)
|
||||||
inner (A.VariableSizes m (A.Variable _ n))
|
inner (A.VariableSizes m (A.Variable _ n))
|
||||||
= do t <- astTypeOf n
|
= do t <- astTypeOf n
|
||||||
f <- fget getScalarType
|
f <- fget getScalarType
|
||||||
|
|
|
@ -886,7 +886,7 @@ cppgenDirectedVariable :: Meta -> A.Type -> CGen () -> A.Direction -> CGen ()
|
||||||
cppgenDirectedVariable m t v dir
|
cppgenDirectedVariable m t v dir
|
||||||
= case t of
|
= case t of
|
||||||
A.ChanEnd {} -> v
|
A.ChanEnd {} -> v
|
||||||
A.Chan {} -> tell ["(("] >> v >> tell [")->",if dir == A.DirInput
|
A.Chan {} -> tell ["(("] >> v >> tell [").",if dir == A.DirInput
|
||||||
then "reader" else "writer","())"]
|
then "reader" else "writer","())"]
|
||||||
A.Array _ (A.ChanEnd {}) -> v
|
A.Array _ (A.ChanEnd {}) -> v
|
||||||
A.Array _ (A.Chan {}) -> dieP m "Should have pulled up directed arrays"
|
A.Array _ (A.Chan {}) -> dieP m "Should have pulled up directed arrays"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user