@@ -3927,6 +3927,18 @@ static __isl_give isl_multi_pw_aff *isl_stream_read_with_params_multi_pw_aff(
#include "isl_stream_read_with_params_templ.c"
#include "isl_read_from_str_templ.c"
+/* Return an empty isl_union_pw_aff with parameter domain "dom".
+ */
+static __isl_give isl_union_pw_aff *empty_union_pw_aff_with_dom(
+ __isl_take isl_set *dom)
+{
+ isl_space *space;
+
+ space = isl_set_get_space(dom);
+ isl_set_free(dom);
+ return isl_union_pw_aff_empty_space(space);
+}
+
/* Read the body of an isl_union_pw_aff from "s" with parameter domain "dom".
*/
static __isl_give isl_union_pw_aff *read_union_pw_aff_with_dom(
@@ -3937,6 +3949,9 @@ static __isl_give isl_union_pw_aff *read_union_pw_aff_with_dom(
isl_set *aff_dom;
int n;
+ if (isl_stream_next_token_is(s, '}'))
+ return empty_union_pw_aff_with_dom(dom);
+
n = v->n;
aff_dom = read_aff_domain(s, isl_set_copy(dom), v);
pa = read_pw_aff_with_dom(s, aff_dom, v);
@@ -294,6 +294,8 @@ static const char *reparse_multi_union_pw_aff_tests[] = {
"A[{ S[x] -> [x + 1]; T[x] -> [x] }]",
"(A[{ S[x] -> [x + 1]; T[x] -> [x] }] : "
"{ S[x] : x > 0; T[y] : y >= 0 })",
+ "A[{ }]",
+ "A[{ }, { S[x] -> [x + 1]; T[x] -> [x] }]",
};
#undef BASE