From a5fc38729a946fab4103a0170b0e2ed881299b7a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 20 May 2012 17:38:53 -0400 Subject: [PATCH] Add isl_restriction_get_ctx Signed-off-by: Andreas Kloeckner Signed-off-by: Sven Verdoolaege --- doc/user.pod | 6 ++++-- include/isl/flow.h | 2 ++ isl_flow.c | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index 793b5bd..d7b2b9a 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -4339,8 +4339,8 @@ and the potential source iterations will be intersected with these sets. If the output needs to be restricted then only a restriction on the source iterations is required. If any error occurs, the callback should return C. -An C object can be created and freed using the following -functions. +An C object can be created, freed and inspected +using the following functions. #include @@ -4355,6 +4355,8 @@ functions. __isl_keep isl_map *source_map); void *isl_restriction_free( __isl_take isl_restriction *restr); + isl_ctx *isl_restriction_get_ctx( + __isl_keep isl_restriction *restr); C and C are special cases of C. C diff --git a/include/isl/flow.h b/include/isl/flow.h index bc3900e..faf1c05 100644 --- a/include/isl/flow.h +++ b/include/isl/flow.h @@ -29,6 +29,8 @@ __isl_give isl_restriction *isl_restriction_input( __isl_give isl_restriction *isl_restriction_output( __isl_take isl_set *source_restr); +isl_ctx *isl_restriction_get_ctx(__isl_keep isl_restriction *restr); + typedef __isl_give isl_restriction *(*isl_access_restrict)( __isl_keep isl_map *source_map, __isl_keep isl_set *sink, void *source_user, void *user); diff --git a/isl_flow.c b/isl_flow.c index 16c4a6c..13e42f3 100644 --- a/isl_flow.c +++ b/isl_flow.c @@ -139,6 +139,11 @@ void *isl_restriction_free(__isl_take isl_restriction *restr) return NULL; } +isl_ctx *isl_restriction_get_ctx(__isl_keep isl_restriction *restr) +{ + return restr ? isl_set_get_ctx(restr->source) : NULL; +} + /* A private structure to keep track of a mapping together with * a user-specified identifier and a boolean indicating whether * the map represents a must or may access/dependence. -- 2.7.4