Add get_ctx() for access_info and flow
authorAndreas Kloeckner <inform@tiker.net>
Sun, 10 Jul 2011 19:15:59 +0000 (15:15 -0400)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 11 Jul 2011 09:43:50 +0000 (11:43 +0200)
Signed-off-by: Andreas Kloeckner <inform@tiker.net>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
include/isl/flow.h
isl_flow.c

index 9606fe9..8fc2698 100644 (file)
@@ -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,
index 6dd6ff5..128aee5 100644 (file)
@@ -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