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)
|
||||
_ -> inner 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
|
||||
wholeT <- astTypeOf wholeV
|
||||
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))
|
||||
= do t <- astTypeOf n
|
||||
f <- fget getScalarType
|
||||
|
|
|
@ -886,7 +886,7 @@ cppgenDirectedVariable :: Meta -> A.Type -> CGen () -> A.Direction -> CGen ()
|
|||
cppgenDirectedVariable m t v dir
|
||||
= case t of
|
||||
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","())"]
|
||||
A.Array _ (A.ChanEnd {}) -> v
|
||||
A.Array _ (A.Chan {}) -> dieP m "Should have pulled up directed arrays"
|
||||
|
|
Loading…
Reference in New Issue
Block a user