This makes the function isl_multi_*_zero opt-in rather than opt-out.
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
@@ -470,6 +470,7 @@ EXTRA_DIST = \
isl_multi_intersect.c \
isl_multi_identity_templ.c \
isl_multi_move_dims_templ.c \
+ isl_multi_zero_templ.c \
print_templ.c \
print_templ_yaml.c \
isl_power_templ.c \
@@ -3824,6 +3824,7 @@ error:
#include <isl_multi_gist.c>
#include <isl_multi_identity_templ.c>
#include <isl_multi_move_dims_templ.c>
+#include <isl_multi_zero_templ.c>
/* Construct an isl_multi_aff living in "space" that corresponds
* to the affine transformation matrix "mat".
@@ -6173,6 +6174,7 @@ error:
#include <isl_multi_align_set.c>
#include <isl_multi_intersect.c>
#include <isl_multi_move_dims_templ.c>
+#include <isl_multi_zero_templ.c>
/* Does "mpa" have a non-trivial explicit domain?
*
@@ -7914,7 +7916,6 @@ error:
#define NO_PRODUCT
#define NO_SPLICE
-#define NO_ZERO
#include <isl_multi_explicit_domain.c>
#include <isl_multi_union_pw_aff_explicit_domain.c>
@@ -593,43 +593,6 @@ error:
return NULL;
}
-#ifndef NO_ZERO
-/* Construct a multi expression in the given space with value zero in
- * each of the output dimensions.
- */
-__isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
-{
- int n;
- MULTI(BASE) *multi;
-
- if (!space)
- return NULL;
-
- n = isl_space_dim(space , isl_dim_out);
- multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
-
- if (!n)
- isl_space_free(space);
- else {
- int i;
- isl_local_space *ls;
- EL *el;
-
- space = isl_space_domain(space);
- ls = isl_local_space_from_space(space);
- el = FN(EL,zero_on_domain)(ls);
-
- for (i = 0; i < n; ++i)
- multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
- FN(EL,copy)(el));
-
- FN(EL,free)(el);
- }
-
- return multi;
-}
-#endif
-
__isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)(
__isl_take MULTI(BASE) *multi,
enum isl_dim_type type, unsigned first, unsigned n)
--- /dev/null
+/*
+ * Copyright 2012 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/space.h>
+#include <isl/local_space.h>
+
+#include <isl_multi_macro.h>
+
+/* Construct a multi expression in the given space with value zero in
+ * each of the output dimensions.
+ */
+__isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
+{
+ int n;
+ MULTI(BASE) *multi;
+
+ if (!space)
+ return NULL;
+
+ n = isl_space_dim(space , isl_dim_out);
+ multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
+
+ if (!n)
+ isl_space_free(space);
+ else {
+ int i;
+ isl_local_space *ls;
+ EL *el;
+
+ space = isl_space_domain(space);
+ ls = isl_local_space_from_space(space);
+ el = FN(EL,zero_on_domain)(ls);
+
+ for (i = 0; i < n; ++i)
+ multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
+ FN(EL,copy)(el));
+
+ FN(EL,free)(el);
+ }
+
+ return multi;
+}
@@ -1671,6 +1671,7 @@ isl_stat isl_val_check_match_domain_space(__isl_keep isl_val *v,
#include <isl_multi_no_explicit_domain.c>
#include <isl_multi_templ.c>
#include <isl_multi_dims.c>
+#include <isl_multi_zero_templ.c>
/* Apply "fn" to each of the elements of "mv" with as second argument "v".
*/