Home | History | Annotate | Download | only in dist

Lines Matching refs:PW

14 /* Make sure "pw" has room for at least "n" more pieces.
16 * If there is only one reference to pw, we extend it in place.
17 * Otherwise, we create a new PW and copy the pieces.
19 static __isl_give PW *FN(PW,grow)(__isl_take PW *pw, int n)
23 PW *res;
25 if (!pw)
27 if (pw->n + n <= pw->size)
28 return pw;
29 ctx = FN(PW,get_ctx)(pw);
30 n += pw->n;
31 if (pw->ref == 1) {
32 res = isl_realloc(ctx, pw, struct PW,
33 sizeof(struct PW) + (n - 1) * sizeof(S(PW,piece)));
35 return FN(PW,free)(pw);
39 res = FN(PW,alloc_size)(isl_space_copy(pw->dim) OPT_TYPE_ARG(pw->), n);
41 return FN(PW,free)(pw);
42 for (i = 0; i < pw->n; ++i)
43 res = FN(PW,add_piece)(res, isl_set_copy(pw->p[i].set),
44 FN(EL,copy)(pw->p[i].FIELD));
45 FN(PW,free)(pw);
49 __isl_give PW *FN(PW,add_disjoint)(__isl_take PW *pw1, __isl_take PW *pw2)
54 if (FN(PW,align_params_bin)(&pw1, &pw2) < 0)
58 return FN(PW,add_disjoint)(pw2, pw1);
64 if (FN(PW,check_equal_space)(pw1, pw2) < 0)
67 if (FN(PW,IS_ZERO)(pw1)) {
68 FN(PW,free)(pw1);
72 if (FN(PW,IS_ZERO)(pw2)) {
73 FN(PW,free)(pw2);
77 pw1 = FN(PW,grow)(pw1, pw2->n);
82 pw1 = FN(PW,add_piece)(pw1,
86 FN(PW,free)(pw2);
90 FN(PW,free)(pw1);
91 FN(PW,free)(pw2);