goto error;
pos = global_pos(dim, type, pos);
- isl_assert(ctx, pos != isl_dim_total(dim), goto error);
+ if (pos == isl_dim_total(dim))
+ goto error;
if (pos >= dim->n_name) {
if (!name)
return NULL;
if (!name_ok(dim->ctx, s))
goto error;
+ isl_name_free(dim->ctx, get_name(dim, type, pos));
name = isl_name_get(dim->ctx, s);
if (!name)
goto error;
enum isl_dim_type dst_type, unsigned dst_pos,
enum isl_dim_type src_type, unsigned src_pos, unsigned n)
{
+ int i;
+
if (!dim)
return NULL;
if (n == 0)
case isl_dim_out: dim->n_out -= n; break;
}
+ if (dst_type != isl_dim_param && src_type != isl_dim_param)
+ return dim;
+
+ for (i = 0; i < 2; ++i) {
+ if (!dim->nested[i])
+ continue;
+ dim->nested[i] = isl_dim_replace(dim->nested[i],
+ isl_dim_param, dim);
+ if (!dim->nested[i])
+ goto error;
+ }
+
return dim;
error:
isl_dim_free(dim);
for (i = 0; i < dim->nparam; ++i) {
name = get_name(dim, isl_dim_param, i);
- hash = isl_hash_builtin(hash, name);
+ hash = isl_hash_name(hash, name);
}
name = tuple_name(dim, isl_dim_in);
- hash = isl_hash_builtin(hash, name);
+ hash = isl_hash_name(hash, name);
name = tuple_name(dim, isl_dim_out);
- hash = isl_hash_builtin(hash, name);
+ hash = isl_hash_name(hash, name);
hash = isl_hash_dim(hash, dim->nested[0]);
hash = isl_hash_dim(hash, dim->nested[1]);