8 static void access_collect_arrays(struct pet_expr
*expr
,
9 set
<ValueDecl
*> &arrays
)
14 id
= isl_map_get_tuple_id(expr
->acc
.access
, isl_dim_out
);
18 decl
= (ValueDecl
*)isl_id_get_user(id
);
24 static void expr_collect_arrays(struct pet_expr
*expr
, set
<ValueDecl
*> &arrays
)
29 for (int i
= 0; i
< expr
->n_arg
; ++i
)
30 expr_collect_arrays(expr
->args
[i
], arrays
);
32 if (expr
->type
== pet_expr_access
)
33 access_collect_arrays(expr
, arrays
);
36 static void stmt_collect_arrays(struct pet_stmt
*stmt
, set
<ValueDecl
*> &arrays
)
40 expr_collect_arrays(stmt
->body
, arrays
);
43 /* Collect the set of all accessed arrays (or scalars) in "scop"
44 * and put them in "arrays".
46 void pet_scop_collect_arrays(struct pet_scop
*scop
, set
<ValueDecl
*> &arrays
)
51 for (int i
= 0; i
< scop
->n_stmt
; ++i
)
52 stmt_collect_arrays(scop
->stmts
[i
], arrays
);