From: Sven Verdoolaege Date: Sun, 13 Oct 2013 12:54:14 +0000 (+0200) Subject: add isl_local_space_set_tuple_id X-Git-Tag: isl-0.13~105 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/51c6124201738b753e84a3bd50ccd3285f2ab061 add isl_local_space_set_tuple_id Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index b09171ba..beaaaff3 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -1030,6 +1030,9 @@ They can be inspected, modified, copied and freed using the following functions. int isl_local_space_is_set(__isl_keep isl_local_space *ls); int isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type); + __isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id); int isl_local_space_has_dim_id( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); diff --git a/include/isl/local_space.h b/include/isl/local_space.h index 59552603..07cce863 100644 --- a/include/isl/local_space.h +++ b/include/isl/local_space.h @@ -23,6 +23,10 @@ void *isl_local_space_free(__isl_take isl_local_space *ls); int isl_local_space_is_set(__isl_keep isl_local_space *ls); +__isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id); + int isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type); int isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, diff --git a/isl_local_space.c b/isl_local_space.c index e1a175de..bf4996c5 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -239,6 +239,21 @@ __isl_give isl_space *isl_local_space_get_space(__isl_keep isl_local_space *ls) return isl_space_copy(ls->dim); } +/* Replace the identifier of the tuple of type "type" by "id". + */ +__isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id) +{ + ls = isl_local_space_cow(ls); + if (!ls) + return isl_id_free(id); + ls->dim = isl_space_set_tuple_id(ls->dim, type, id); + if (!ls->dim) + return isl_local_space_free(ls); + return ls; +} + __isl_give isl_local_space *isl_local_space_set_dim_name( __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, const char *s)