2 * Copyright 2010 INRIA Saclay
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
8 * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
11 #include "isl_union_macro.h"
13 /* Print "pw" in a sequence of "PART" objects delimited by semicolons.
14 * Each "PART" object itself is also printed as a semicolon delimited
16 * If data->first = 1, then this is the first in the sequence.
17 * Update data->first to tell the next element that it is not the first.
19 static isl_stat
FN(print_body_wrap
,BASE
)(__isl_take PART
*pw
,
22 struct isl_union_print_data
*data
;
23 data
= (struct isl_union_print_data
*) user
;
26 data
->p
= isl_printer_print_str(data
->p
, "; ");
29 data
->p
= FN(print_body
,BASE
)(data
->p
, pw
);
32 return isl_stat_non_null(data
->p
);
35 /* Print the body of "u" (everything except the parameter declarations)
36 * to "p" in isl format.
38 static __isl_give isl_printer
*FN(print_body_union
,BASE
)(
39 __isl_take isl_printer
*p
, __isl_keep UNION
*u
)
41 struct isl_union_print_data data
;
43 p
= isl_printer_print_str(p
, s_open_set
[0]);
46 if (FN(FN(UNION
,foreach
),BASE
)(u
, &FN(print_body_wrap
,BASE
), &data
) < 0)
47 data
.p
= isl_printer_free(data
.p
);
49 p
= isl_printer_print_str(p
, s_close_set
[0]);
54 /* Print the "UNION" object "u" to "p" in isl format.
56 static __isl_give isl_printer
*FN(FN(print_union
,BASE
),isl
)(
57 __isl_take isl_printer
*p
, __isl_keep UNION
*u
)
59 struct isl_print_space_data space_data
= { 0 };
62 space
= FN(UNION
,get_space
)(u
);
63 p
= print_param_tuple(p
, space
, &space_data
);
64 isl_space_free(space
);
66 p
= FN(print_body_union
,BASE
)(p
, u
);