From ffbcd033895737a4068d2a4376aff3d0da434eef Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 6 Dec 2011 09:17:03 +0100 Subject: add isl_space_map_from_domain_and_range Signed-off-by: Sven Verdoolaege --- isl_space.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'isl_space.c') diff --git a/isl_space.c b/isl_space.c index ae68013b..88b96268 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1067,6 +1067,24 @@ error: return NULL; } +__isl_give isl_space *isl_space_map_from_domain_and_range( + __isl_take isl_space *domain, __isl_take isl_space *range) +{ + if (!domain || !range) + goto error; + if (!isl_space_is_set(domain)) + isl_die(isl_space_get_ctx(domain), isl_error_invalid, + "domain is not a set space", goto error); + if (!isl_space_is_set(range)) + isl_die(isl_space_get_ctx(range), isl_error_invalid, + "range is not a set space", goto error); + return isl_space_join(isl_space_reverse(domain), range); +error: + isl_space_free(domain); + isl_space_free(range); + return NULL; +} + static __isl_give isl_space *set_ids(__isl_take isl_space *dim, enum isl_dim_type type, unsigned first, unsigned n, __isl_take isl_id **ids) -- cgit v1.2.3