On Thu, Aug 11, 2011 at 04:59:43PM -0500, Sebastian Pop wrote:
> >>> + {
> >>> + isl_dim *dc = isl_set_get_dim (scop->context);
> >>> + int nb_in = isl_dim_size (dc, isl_dim_set);
> >>> + int nb_out = 1 + DR_NUM_DIMENSIONS (dr);
> >>> + int nbp = scop_nb_params (scop);
> >>> + isl_dim *dim = isl_dim_alloc (scop->ctx, nbp, nb_in, nb_out);
> >>> + int i;
> >>> +
> >>> + for (i = 0; i < nbp; i++)
> >>> + dim = isl_dim_set_dim_id (dim, isl_dim_param, i,
> >>> + isl_dim_get_dim_id (dc, isl_dim_param, i));
> >>> + for (i = 0; i < nb_in; i++)
> >>> + dim = isl_dim_set_dim_id (dim, isl_dim_in, i,
> >>> + isl_dim_get_dim_id (dc, isl_dim_set, i));
> >>
> >> This is dangerous too. Why don't you derive dim directly from dc
> >> instead of creating a fresh dim and then trying to copy some information?
> >
> > Yes, thanks for pointing this out. I will fix this.
>
> I am confused on this one:
> which function should I use to create dim from dc?
It looks like you want to do
dim = isl_dim_add(isl_dim_from_domain(dc), isl_dim_out, nb_out);
skimo