add private isl_local_space_reset_dim
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 8 Jul 2011 15:35:54 +0000 (17:35 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 9 Jul 2011 14:11:40 +0000 (16:11 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_local_space.c
isl_local_space_private.h

index 6449668..51602f8 100644 (file)
@@ -215,6 +215,23 @@ __isl_give isl_local_space *isl_local_space_set_dim_name(
        return ls;
 }
 
+__isl_give isl_local_space *isl_local_space_reset_dim(
+       __isl_take isl_local_space *ls, __isl_take isl_dim *dim)
+{
+       ls = isl_local_space_cow(ls);
+       if (!ls || !dim)
+               goto error;
+
+       isl_dim_free(ls->dim);
+       ls->dim = dim;
+
+       return ls;
+error:
+       isl_local_space_free(ls);
+       isl_dim_free(dim);
+       return NULL;
+}
+
 __isl_give isl_local_space *isl_local_space_add_div(
        __isl_take isl_local_space *ls, __isl_take isl_vec *div)
 {
index 76d74b5..4e5cc04 100644 (file)
@@ -35,4 +35,7 @@ __isl_give isl_local_space *isl_local_space_substitute_equalities(
 int isl_local_space_is_named_or_nested(__isl_keep isl_local_space *ls,
        enum isl_dim_type type);
 
+__isl_give isl_local_space *isl_local_space_reset_dim(
+       __isl_take isl_local_space *ls, __isl_take isl_dim *dim);
+
 #endif