From 4e81432fb6a5b608d78387a9655c52a6f4034efd Mon Sep 17 00:00:00 2001 From: Ron Estrin Date: Sat, 18 Jan 2020 19:38:23 +0100 Subject: [PATCH] export isl_map_from_multi_pw_aff as isl_multi_pw_aff_as_map In the bindings, it is more convenient to use a method on the object being converted than to call a named constructor with the object as argument. The function has an infix "as" because only functions living in a map space can be converted to an isl_map. This naming is consistent with the "as" method in the C++ interface of type based subclasses. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 3 +++ include/isl/aff.h | 2 ++ isl_aff_map.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 4522d3ef..7ed2cbfe 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2279,6 +2279,8 @@ involve any NaN. __isl_take isl_multi_pw_aff *mpa); __isl_give isl_set *isl_set_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_map *isl_multi_pw_aff_as_map( + __isl_take isl_multi_pw_aff *mpa); __isl_give isl_map *isl_map_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa); __isl_give isl_union_map *isl_union_map_from_union_pw_aff( @@ -2306,6 +2308,7 @@ for the pair C and C, for the pair C and C, for the pair C and C, the pair C and C, +the pair C and C, and C and C. diff --git a/include/isl/aff.h b/include/isl/aff.h index 8059851f..bdecf7b8 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -1109,6 +1109,8 @@ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims( __isl_export __isl_give isl_set *isl_multi_pw_aff_as_set(__isl_take isl_multi_pw_aff *mpa); __isl_give isl_set *isl_set_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa); +__isl_export +__isl_give isl_map *isl_multi_pw_aff_as_map(__isl_take isl_multi_pw_aff *mpa); __isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa); diff --git a/isl_aff_map.c b/isl_aff_map.c index 234e420d..f661b824 100644 --- a/isl_aff_map.c +++ b/isl_aff_map.c @@ -478,6 +478,14 @@ __isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa) return map_from_multi_pw_aff(mpa); } +/* This function performs the same operation as isl_map_from_multi_pw_aff, + * but is considered as a function on an isl_multi_pw_aff when exported. + */ +__isl_give isl_map *isl_multi_pw_aff_as_map(__isl_take isl_multi_pw_aff *mpa) +{ + return isl_map_from_multi_pw_aff(mpa); +} + /* Construct a set mapping the shared parameter domain * of the piecewise affine expressions to the space of "mpa" * with each dimension in the range equated to the