@@ -647,6 +647,7 @@ EXTRA_DIST = \
isl_union_map_lex_templ.c \
isl_union_neg.c \
isl_union_pw_templ.c \
+ isl_union_sub_templ.c \
libisl-gdb.py \
doc/CodingStyle \
doc/SubmittingPatches \
@@ -2813,6 +2813,7 @@ static __isl_give isl_aff *isl_aff_zero_in_space(__isl_take isl_space *space)
#include <isl_union_single.c>
#include <isl_union_neg.c>
+#include <isl_union_sub_templ.c>
#undef BASE
#define BASE aff
@@ -4621,6 +4622,7 @@ __isl_give isl_set *isl_multi_aff_lex_gt_set(__isl_take isl_multi_aff *ma1,
#include <isl_union_multi.c>
#include "isl_union_locals_templ.c"
#include <isl_union_neg.c>
+#include <isl_union_sub_templ.c>
#undef BASE
#define BASE multi_aff
@@ -964,8 +964,6 @@ static __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_zero_in_space(
#undef BASE
#define BASE pw_qpolynomial_fold
-#define NO_SUB
-
#include <isl_union_single.c>
#include <isl_union_eval.c>
@@ -3128,6 +3128,7 @@ static __isl_give isl_qpolynomial *isl_qpolynomial_zero_in_space(
#include <isl_union_single.c>
#include <isl_union_eval.c>
#include <isl_union_neg.c>
+#include <isl_union_sub_templ.c>
int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial *pwqp)
{
--- /dev/null
+/*
+ * Copyright 2010 INRIA Saclay
+ *
+ * Use of this software is governed by the MIT license
+ *
+ * Written by Sven Verdoolaege,
+ * INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
+ * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
+ */
+
+#include "isl_union_macro.h"
+
+/* Subtract "u2" from "u1" and return the result.
+ *
+ * If the base expressions have a default zero value, then
+ * reuse isl_union_*_add to ensure the result
+ * is computed on the union of the domains of "u1" and "u2".
+ * Otherwise, compute the result directly on their shared domain.
+ */
+__isl_give UNION *FN(UNION,sub)(__isl_take UNION *u1, __isl_take UNION *u2)
+{
+#if DEFAULT_IS_ZERO
+ return FN(UNION,add)(u1, FN(UNION,neg)(u2));
+#else
+ return FN(UNION,match_bin_op)(u1, u2, &FN(PART,sub));
+#endif
+}
@@ -647,24 +647,6 @@ __isl_give UNION *FN(UNION,add)(__isl_take UNION *u1, __isl_take UNION *u2)
#endif
}
-#ifndef NO_SUB
-/* Subtract "u2" from "u1" and return the result.
- *
- * If the base expressions have a default zero value, then
- * reuse isl_union_*_add to ensure the result
- * is computed on the union of the domains of "u1" and "u2".
- * Otherwise, compute the result directly on their shared domain.
- */
-__isl_give UNION *FN(UNION,sub)(__isl_take UNION *u1, __isl_take UNION *u2)
-{
-#if DEFAULT_IS_ZERO
- return FN(UNION,add)(u1, FN(UNION,neg)(u2));
-#else
- return FN(UNION,match_bin_op)(u1, u2, &FN(PART,sub));
-#endif
-}
-#endif
-
S(UNION,any_set_data) {
isl_set *set;
__isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*);