From a19ceb63b51944e57e1405c6e52a936618b3fa9a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 21 Sep 2017 14:04:27 +0200 Subject: [PATCH] isl_output.c: print_affine: drop isl_basic_map argument The isl_basic_map argument is only used to determine the size of the affine expression, but ever since isl-0.15-265-g93ce389e43 (isl_printer_print_map: print explicit representations of divs in constraints, Tue Dec 1 15:14:21 2015 +0100), the function is passed both space information and information about local variables. The size of the affine expression can be determined from these two pieces of information. Signed-off-by: Sven Verdoolaege --- isl_output.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/isl_output.c b/isl_output.c index f554ce1e..f051156f 100644 --- a/isl_output.c +++ b/isl_output.c @@ -316,15 +316,20 @@ static __isl_give isl_printer *print_affine_of_len(__isl_keep isl_space *dim, return p; } -/* Print an affine expression "c" corresponding to a constraint in "bmap" +/* Print an affine expression "c" * to "p", with the variable names taken from "space" and * the integer division definitions taken from "div". */ -static __isl_give isl_printer *print_affine(__isl_keep isl_basic_map *bmap, - __isl_keep isl_space *space, __isl_keep isl_mat *div, - __isl_take isl_printer *p, isl_int *c) +static __isl_give isl_printer *print_affine(__isl_take isl_printer *p, + __isl_keep isl_space *space, __isl_keep isl_mat *div, isl_int *c) { - unsigned len = 1 + isl_basic_map_total_dim(bmap); + unsigned n_div; + unsigned len; + + if (!space || !div) + return isl_printer_free(p); + n_div = isl_mat_rows(div); + len = 1 + isl_space_dim(space, isl_dim_all) + n_div; return print_affine_of_len(space, div, p, c, len); } @@ -511,7 +516,7 @@ static __isl_give isl_printer *print_half_constraint( int latex) { isl_int_set_si(c[last], 0); - p = print_affine(bmap, space, div, p, c); + p = print_affine(p, space, div, c); p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, op); @@ -543,7 +548,7 @@ static __isl_give isl_printer *print_constraint(__isl_keep isl_basic_map *bmap, p = isl_printer_print_str(p, " "); isl_int_set_si(c[last], 0); - p = print_affine(bmap, space, div, p, c); + p = print_affine(p, space, div, c); return p; } -- 2.11.4.GIT