From: Sven Verdoolaege Date: Sat, 3 Mar 2012 13:21:09 +0000 (+0100) Subject: add isl_map_has_dim_name X-Git-Tag: isl-0.11~268 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdd23f743e84403c8a893ade07ba3f7405eb828d;p=platform%2Fupstream%2Fisl.git add isl_map_has_dim_name Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index 7f501ef..d0aef03 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -1659,6 +1659,8 @@ read off using the following functions. const char *isl_basic_map_get_dim_name( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); + int isl_map_has_dim_name(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); const char *isl_map_get_dim_name( __isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); diff --git a/include/isl/map.h b/include/isl/map.h index 795eff5..c5378e0 100644 --- a/include/isl/map.h +++ b/include/isl/map.h @@ -76,6 +76,8 @@ __isl_give isl_map *isl_map_set_tuple_name(__isl_take isl_map *map, enum isl_dim_type type, const char *s); const char *isl_basic_map_get_dim_name(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); +int isl_map_has_dim_name(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); const char *isl_map_get_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); __isl_give isl_basic_map *isl_basic_map_set_dim_name( diff --git a/isl_map.c b/isl_map.c index e68b192..44a2056 100644 --- a/isl_map.c +++ b/isl_map.c @@ -506,6 +506,14 @@ const char *isl_basic_set_get_dim_name(__isl_keep isl_basic_set *bset, return bset ? isl_space_get_dim_name(bset->dim, type, pos) : NULL; } +/* Does the given dimension have a name? + */ +int isl_map_has_dim_name(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos) +{ + return map ? isl_space_has_dim_name(map->dim, type, pos) : -1; +} + const char *isl_map_get_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos) {