From 56d2cd905c7322cbca2a4a9b628412e406d3c290 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 7 Aug 2012 15:45:43 +0200 Subject: [PATCH] add isl_space_is_map Signed-off-by: Sven Verdoolaege --- doc/user.pod | 1 + include/isl/space.h | 1 + isl_space.c | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 6e359a97..c2bfe06f 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -614,6 +614,7 @@ or whether it is a parameter space, use these functions: #include int isl_space_is_params(__isl_keep isl_space *space); int isl_space_is_set(__isl_keep isl_space *space); + int isl_space_is_map(__isl_keep isl_space *space); It is often useful to create objects that live in the same space as some other object. This can be accomplished diff --git a/include/isl/space.h b/include/isl/space.h index 45aee976..e786442c 100644 --- a/include/isl/space.h +++ b/include/isl/space.h @@ -42,6 +42,7 @@ void isl_space_free(__isl_take isl_space *dim); int isl_space_is_params(__isl_keep isl_space *space); int isl_space_is_set(__isl_keep isl_space *space); +int isl_space_is_map(__isl_keep isl_space *space); __isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *dim, enum isl_dim_type type, const char *s); diff --git a/isl_space.c b/isl_space.c index ac4cd412..539be861 100644 --- a/isl_space.c +++ b/isl_space.c @@ -73,6 +73,16 @@ int isl_space_is_set(__isl_keep isl_space *space) return 1; } +/* Is the given space that of a map? + */ +int isl_space_is_map(__isl_keep isl_space *space) +{ + if (!space) + return -1; + return space->tuple_id[0] != &isl_id_none && + space->tuple_id[1] != &isl_id_none; +} + __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx, unsigned nparam, unsigned dim) { -- 2.11.4.GIT