From 0089b107a3ceb5b5356333ca346dcbd2a1c7db25 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 24 Sep 2011 18:07:52 +0200 Subject: [PATCH] add isl_local_space_set_dim_id Signed-off-by: Sven Verdoolaege --- doc/user.pod | 6 +++++- include/isl/local_space.h | 3 +++ isl_local_space.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/user.pod b/doc/user.pod index 04954a5..63058ac 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -739,7 +739,7 @@ A new local space can be created from a space using __isl_give isl_local_space *isl_local_space_from_space( __isl_take isl_space *space); -They can be inspected, copied and freed using the following functions. +They can be inspected, modified, copied and freed using the following functions. #include isl_ctx *isl_local_space_get_ctx( @@ -753,6 +753,10 @@ They can be inspected, copied and freed using the following functions. __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); + __isl_give isl_local_space *isl_local_space_set_dim_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); __isl_give isl_space *isl_local_space_get_space( __isl_keep isl_local_space *ls); __isl_give isl_aff *isl_local_space_get_div( diff --git a/include/isl/local_space.h b/include/isl/local_space.h index 13d4944..bde4ddf 100644 --- a/include/isl/local_space.h +++ b/include/isl/local_space.h @@ -29,6 +29,9 @@ const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *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); +__isl_give isl_local_space *isl_local_space_set_dim_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); __isl_give isl_space *isl_local_space_get_space(__isl_keep isl_local_space *ls); __isl_give isl_aff *isl_local_space_get_div(__isl_keep isl_local_space *ls, int pos); diff --git a/isl_local_space.c b/isl_local_space.c index ebf222c..42527c7 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -226,6 +226,20 @@ __isl_give isl_local_space *isl_local_space_set_dim_name( return ls; } +__isl_give isl_local_space *isl_local_space_set_dim_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos, __isl_take isl_id *id) +{ + ls = isl_local_space_cow(ls); + if (!ls) + return isl_id_free(id); + ls->dim = isl_space_set_dim_id(ls->dim, type, pos, id); + if (!ls->dim) + return isl_local_space_free(ls); + + return ls; +} + __isl_give isl_local_space *isl_local_space_reset_space( __isl_take isl_local_space *ls, __isl_take isl_space *dim) { -- 2.7.4