From 9149cbdb3d852e5c4575f2eeddc51c8cfa69c05b Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 14 Nov 2010 14:11:42 +0100 Subject: isl_printer_print_pw_qpolynomial{,_fold}: always print special domains If the domain of a piecewise quasipolynomial (fold) is the zero-dimensional space, then we don't print the "[] -> " to avoid clutter. However, if the domain has a name or if it has internal structure then it should be printed explicitly as otherwise no distinction can be made with the unnamed unstructured zero-dimensional space. Signed-off-by: Sven Verdoolaege --- isl_output.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/isl_output.c b/isl_output.c index 6f81e1ae..305b9cbf 100644 --- a/isl_output.c +++ b/isl_output.c @@ -1451,8 +1451,8 @@ static __isl_give isl_printer *isl_pwqp_print_isl_body( for (i = 0; i < pwqp->n; ++i) { if (i) p = isl_printer_print_str(p, "; "); - if (isl_dim_size(pwqp->p[i].set->dim, isl_dim_set) > 0 || - isl_dim_get_tuple_name(pwqp->p[i].set->dim, isl_dim_set)) { + if (isl_dim_size(pwqp->dim, isl_dim_set) > 0 || + isl_dim_is_named_or_nested(pwqp->dim, isl_dim_set)) { p = print_dim(pwqp->p[i].set->dim, p, 1, 0, NULL); p = isl_printer_print_str(p, " -> "); } @@ -1475,7 +1475,8 @@ static __isl_give isl_printer *print_pw_qpolynomial_isl( } p = isl_printer_print_str(p, "{ "); if (pwqp->n == 0) { - if (isl_dim_size(pwqp->dim, isl_dim_set) > 0) { + if (isl_dim_size(pwqp->dim, isl_dim_set) > 0 || + isl_dim_is_named_or_nested(pwqp->dim, isl_dim_set)) { p = print_dim(pwqp->dim, p, 1, 0, NULL); p = isl_printer_print_str(p, " -> "); } @@ -1512,7 +1513,8 @@ static __isl_give isl_printer *isl_pwf_print_isl_body( for (i = 0; i < pwf->n; ++i) { if (i) p = isl_printer_print_str(p, "; "); - if (isl_dim_size(pwf->p[i].set->dim, isl_dim_set) > 0) { + if (isl_dim_size(pwf->dim, isl_dim_set) > 0 || + isl_dim_is_named_or_nested(pwf->dim, isl_dim_set)) { p = print_dim(pwf->p[i].set->dim, p, 1, 0, NULL); p = isl_printer_print_str(p, " -> "); } @@ -1532,7 +1534,8 @@ static __isl_give isl_printer *print_pw_qpolynomial_fold_isl( } p = isl_printer_print_str(p, "{ "); if (pwf->n == 0) { - if (isl_dim_size(pwf->dim, isl_dim_set) > 0) { + if (isl_dim_size(pwf->dim, isl_dim_set) > 0 || + isl_dim_is_named_or_nested(pwf->dim, isl_dim_set)) { p = print_dim(pwf->dim, p, 1, 0, NULL); p = isl_printer_print_str(p, " -> "); } -- cgit v1.2.3