add isl_map_has_dim_name
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 3 Mar 2012 13:21:09 +0000 (14:21 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Aug 2012 10:20:08 +0000 (12:20 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/map.h
isl_map.c

index 7f501ef..d0aef03 100644 (file)
@@ -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);
index 795eff5..c5378e0 100644 (file)
@@ -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(
index e68b192..44a2056 100644 (file)
--- 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)
 {