From d194584d5cb39d611e597e37961d14369a8cad81 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 10 Jul 2011 15:15:59 -0400 Subject: [PATCH] Add get_ctx() for access_info and flow Signed-off-by: Andreas Kloeckner Signed-off-by: Sven Verdoolaege --- include/isl/flow.h | 5 +++++ isl_flow.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/isl/flow.h b/include/isl/flow.h index 9606fe9..8fc2698 100644 --- a/include/isl/flow.h +++ b/include/isl/flow.h @@ -27,6 +27,9 @@ __isl_give isl_access_info *isl_access_info_add_source( __isl_take isl_access_info *acc, __isl_take isl_map *source, int must, void *source_user); void isl_access_info_free(__isl_take isl_access_info *acc); + +isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc); + __isl_give isl_flow *isl_access_info_compute_flow(__isl_take isl_access_info *acc); int isl_flow_foreach(__isl_keep isl_flow *deps, int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), @@ -34,6 +37,8 @@ int isl_flow_foreach(__isl_keep isl_flow *deps, __isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must); void isl_flow_free(__isl_take isl_flow *deps); +isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps); + int isl_union_map_compute_flow(__isl_take isl_union_map *sink, __isl_take isl_union_map *must_source, __isl_take isl_union_map *may_source, diff --git a/isl_flow.c b/isl_flow.c index 6dd6ff5..128aee5 100644 --- a/isl_flow.c +++ b/isl_flow.c @@ -102,6 +102,11 @@ void isl_access_info_free(__isl_take isl_access_info *acc) free(acc); } +isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc) +{ + return acc ? isl_map_get_ctx(acc->sink.map) : NULL; +} + /* Add another source to an isl_access_info structure, making * sure the "must" sources are placed before the "may" sources. * This function may be called at most max_source times on a @@ -352,6 +357,11 @@ void isl_flow_free(__isl_take isl_flow *deps) free(deps); } +isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps) +{ + return deps ? isl_set_get_ctx(deps->must_no_source) : NULL; +} + /* Return a map that enforces that the domain iteration occurs after * the range iteration at the given level. * If level is odd, then the domain iteration should occur after -- 2.7.4