Changed pullUp to pull up channel arrays that have direction specifiers applied to the whole array
For example, a call like foo(6, cs!) will have cs! pulled up, iff cs was of type CHAN X. If cs was of type CHAN! X, nothing is done (and the needless direction will be removed later on).
This commit is contained in:
parent
a416f7dac9
commit
766cb09dcf
|
@ -382,6 +382,15 @@ pullUp pullUpArraysInsideRecords = pass "Pull up definitions"
|
|||
isSlice (A.SubscriptFrom {}) = True
|
||||
isSlice (A.SubscriptFor {}) = True
|
||||
isSlice _ = False
|
||||
doVariable v@(A.DirectedVariable m dir innerV)
|
||||
= do t <- astTypeOf innerV
|
||||
case t of
|
||||
A.Array ds (A.Chan attr innerT) ->
|
||||
do spec@(A.Specification _ n _) <- makeNonceIs "dir_array" m
|
||||
(A.Array ds $ A.ChanEnd dir attr innerT) A.Abbrev v
|
||||
addPulled $ (m, Left spec)
|
||||
return $ A.Variable m n
|
||||
_ -> descend v
|
||||
|
||||
doVariable v = descend v
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user