add isl_space_has_dim_name
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 17 Jan 2012 11:04:02 +0000 (12:04 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 26 Feb 2012 08:48:47 +0000 (09:48 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/space.h
isl_space.c

index 7515647..1436789 100644 (file)
@@ -679,6 +679,8 @@ using the following functions.
        __isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *space,
                                 enum isl_dim_type type, unsigned pos,
                                 __isl_keep const char *name);
+       int isl_space_has_dim_name(__isl_keep isl_space *space,
+               enum isl_dim_type type, unsigned pos);
        __isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *space,
                                 enum isl_dim_type type, unsigned pos);
 
index afbd3e3..9b54df5 100644 (file)
@@ -67,6 +67,8 @@ int isl_space_find_dim_by_id(__isl_keep isl_space *dim, enum isl_dim_type type,
 int isl_space_find_dim_by_name(__isl_keep isl_space *space,
        enum isl_dim_type type, const char *name);
 
+int isl_space_has_dim_name(__isl_keep isl_space *space,
+       enum isl_dim_type type, unsigned pos);
 __isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *dim,
                                 enum isl_dim_type type, unsigned pos,
                                 __isl_keep const char *name);
index 48f6385..6a6b5f5 100644 (file)
@@ -537,6 +537,19 @@ error:
        return NULL;
 }
 
+/* Does the given dimension have a name?
+ */
+int isl_space_has_dim_name(__isl_keep isl_space *space,
+       enum isl_dim_type type, unsigned pos)
+{
+       isl_id *id;
+
+       if (!space)
+               return -1;
+       id = get_id(space, type, pos);
+       return id && id->name;
+}
+
 __isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *dim,
                                 enum isl_dim_type type, unsigned pos)
 {