isl_test_cpp17-generic.cc: work around std::optional::value issue in older macOS
[isl.git] / isl_from_range_templ.c
blob08c640d8b9b67019da9095475d0002eecfdfa79e
1 /*
2 * Copyright 2013 Ecole Normale Superieure
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
10 /* Convert an object defined over a parameter domain
11 * into one that is defined over a zero-dimensional set.
13 __isl_give TYPE *FN(TYPE,from_range)(__isl_take TYPE *obj)
15 isl_space *space;
17 if (!obj)
18 return NULL;
19 if (!isl_space_is_set(FN(TYPE,peek_space)(obj)))
20 isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid,
21 "not living in a set space",
22 return FN(TYPE,free)(obj));
24 space = FN(TYPE,get_space)(obj);
25 space = isl_space_from_range(space);
26 obj = FN(TYPE,reset_space)(obj, space);
28 return obj;