isl_multi_templ.c: extract out isl_multi_domain_templ.c
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 30 Apr 2018 12:08:01 +0000 (30 14:08 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 13 Aug 2018 14:19:35 +0000 (13 16:19 +0200)
This makes the function isl_multi_*_domain opt-in rather than opt-out.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
Makefile.am
isl_aff.c
isl_multi_domain_templ.c [new file with mode: 0644]
isl_multi_templ.c
isl_val.c

index 6c1729b..c28e11b 100644 (file)
@@ -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 \
index c967277..1b247e5 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.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
diff --git a/isl_multi_domain_templ.c b/isl_multi_domain_templ.c
new file mode 100644 (file)
index 0000000..6aa97fe
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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;
+}
index 8638438..a93af2a 100644 (file)
@@ -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)
index 06e2874..3d310c2 100644 (file)
--- a/isl_val.c
+++ b/isl_val.c
@@ -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