From e204a4f8dc6cbbcefded091c370cedb8bd64b9ec Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 24 Jun 2011 12:43:48 +0200 Subject: [PATCH] isl_printer_print_aff: always print parentheses around expression This allows an integer isl_aff to be parsed as a map, even if the expression starts with an integer division. Signed-off-by: Sven Verdoolaege --- isl_output.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/isl_output.c b/isl_output.c index bfd64577..5ada3741 100644 --- a/isl_output.c +++ b/isl_output.c @@ -2231,11 +2231,12 @@ __isl_give isl_printer *isl_printer_print_aff(__isl_take isl_printer *p, p = isl_printer_print_str(p, "{ "); p = print_tuple(aff->ls->dim, p, isl_dim_set, 1, 0, NULL); p = isl_printer_print_str(p, " -> ["); - if (!isl_int_is_one(aff->v->el[0])) - p = isl_printer_print_str(p, "("); + p = isl_printer_print_str(p, "("); p = print_affine_of_len(aff->ls->dim, aff->ls->div, p, aff->v->el + 1, 1 + total, 1); - if (!isl_int_is_one(aff->v->el[0])) { + if (isl_int_is_one(aff->v->el[0])) + p = isl_printer_print_str(p, ")"); + else { p = isl_printer_print_str(p, ")/"); p = isl_printer_print_isl_int(p, aff->v->el[0]); } -- 2.11.4.GIT