This makes the function isl_multi_*_domain opt-in rather than opt-out.
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
@@ -462,6 +462,7 @@ EXTRA_DIST = \
isl_multi_cmp.c \
isl_multi_coalesce.c \
isl_multi_dims.c \
+ isl_multi_domain_templ.c \
isl_multi_floor.c \
isl_multi_gist.c \
isl_multi_hash.c \
@@ -3813,7 +3813,6 @@ error:
#define BASE aff
#undef DOMBASE
#define DOMBASE set
-#define NO_DOMAIN
#include <isl_multi_no_explicit_domain.c>
#include <isl_multi_templ.c>
@@ -3823,8 +3822,6 @@ error:
#include <isl_multi_floor.c>
#include <isl_multi_gist.c>
-#undef NO_DOMAIN
-
/* Construct an isl_multi_aff living in "space" that corresponds
* to the affine transformation matrix "mat".
*/
@@ -6164,6 +6161,7 @@ error:
#include <isl_multi_templ.c>
#include <isl_multi_apply_set.c>
#include <isl_multi_coalesce.c>
+#include <isl_multi_domain_templ.c>
#include <isl_multi_dims.c>
#include <isl_multi_gist.c>
#include <isl_multi_hash.c>
@@ -7909,7 +7907,6 @@ error:
#define DOMBASE union_set
#define NO_MOVE_DIMS
-#define NO_DOMAIN
#define NO_PRODUCT
#define NO_SPLICE
#define NO_ZERO
--- /dev/null
+/*
+ * Copyright 2013 Ecole Normale Superieure
+ *
+ * Use of this software is governed by the MIT license
+ *
+ * Written by Sven Verdoolaege,
+ * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
+ */
+
+#include <isl/set.h>
+
+#include <isl_multi_macro.h>
+
+/* Return the shared domain of the elements of "multi".
+ *
+ * If "multi" has an explicit domain, then return this domain.
+ */
+__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi)
+{
+ int i;
+ isl_set *dom;
+
+ if (!multi)
+ return NULL;
+
+ if (FN(MULTI(BASE),has_explicit_domain)(multi)) {
+ dom = FN(MULTI(BASE),get_explicit_domain)(multi);
+ FN(MULTI(BASE),free)(multi);
+ return dom;
+ }
+
+ dom = isl_set_universe(FN(MULTI(BASE),get_domain_space)(multi));
+ for (i = 0; i < multi->n; ++i) {
+ isl_set *dom_i;
+
+ dom_i = FN(EL,domain)(FN(FN(MULTI(BASE),get),BASE)(multi, i));
+ dom = isl_set_intersect(dom, dom_i);
+ }
+
+ FN(MULTI(BASE),free)(multi);
+ return dom;
+}
@@ -1545,38 +1545,6 @@ isl_bool FN(MULTI(BASE),involves_nan)(__isl_keep MULTI(BASE) *multi)
return isl_bool_false;
}
-#ifndef NO_DOMAIN
-/* Return the shared domain of the elements of "multi".
- *
- * If "multi" has an explicit domain, then return this domain.
- */
-__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi)
-{
- int i;
- isl_set *dom;
-
- if (!multi)
- return NULL;
-
- if (FN(MULTI(BASE),has_explicit_domain)(multi)) {
- dom = FN(MULTI(BASE),get_explicit_domain)(multi);
- FN(MULTI(BASE),free)(multi);
- return dom;
- }
-
- dom = isl_set_universe(FN(MULTI(BASE),get_domain_space)(multi));
- for (i = 0; i < multi->n; ++i) {
- isl_set *dom_i;
-
- dom_i = FN(EL,domain)(FN(FN(MULTI(BASE),get),BASE)(multi, i));
- dom = isl_set_intersect(dom, dom_i);
- }
-
- FN(MULTI(BASE),free)(multi);
- return dom;
-}
-#endif
-
/* Return the opposite of "multi".
*/
__isl_give MULTI(BASE) *FN(MULTI(BASE),neg)(__isl_take MULTI(BASE) *multi)
@@ -1668,7 +1668,6 @@ isl_stat isl_val_check_match_domain_space(__isl_keep isl_val *v,
#undef BASE
#define BASE val
-#define NO_DOMAIN
#define NO_IDENTITY
#define NO_FROM_BASE
#define NO_MOVE_DIMS