Polly 19.0.0git
isl_union_print_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 INRIA Saclay
3 *
4 * Use of this software is governed by the MIT license
5 *
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
9 */
10
11#include "isl_union_macro.h"
12
13/* Print "pw" in a sequence of "PART" objects delimited by semicolons.
14 * Each "PART" object itself is also printed as a semicolon delimited
15 * sequence of pieces.
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.
18 */
19static isl_stat FN(print_body_wrap,BASE)(__isl_take PART *pw,
20 void *user)
21{
22 struct isl_union_print_data *data;
23 data = (struct isl_union_print_data *) user;
24
25 if (!data->first)
26 data->p = isl_printer_print_str(data->p, "; ");
27 data->first = 0;
28
29 data->p = FN(print_body,BASE)(data->p, pw);
30 FN(PART,free)(pw);
31
32 return isl_stat_non_null(data->p);
33}
34
35/* Print the body of "u" (everything except the parameter declarations)
36 * to "p" in isl format.
37 */
38static __isl_give isl_printer *FN(print_body_union,BASE)(
40{
41 struct isl_union_print_data data;
42
44 data.p = p;
45 data.first = 1;
46 if (FN(FN(UNION,foreach),BASE)(u, &FN(print_body_wrap,BASE), &data) < 0)
47 data.p = isl_printer_free(data.p);
48 p = data.p;
50
51 return p;
52}
53
54/* Print the "UNION" object "u" to "p" in isl format.
55 */
56static __isl_give isl_printer *FN(FN(print_union,BASE),isl)(
58{
59 struct isl_print_space_data space_data = { 0 };
61
62 space = FN(UNION,get_space)(u);
63 p = print_param_tuple(p, space, &space_data);
65
66 p = FN(print_body_union,BASE)(p, u);
67
68 return p;
69}
#define FN(TYPE, NAME)
isl_stat isl_stat_non_null(void *obj)
Definition: isl_ctx.c:22
#define __isl_take
Definition: ctx.h:22
isl_stat
Definition: ctx.h:84
#define __isl_give
Definition: ctx.h:19
#define __isl_keep
Definition: ctx.h:25
#define BASE
Definition: flow_cmp.c:49
isl_stat isl_stat(*) void user)
Definition: hmap.h:39
static const char * s_open_set[2]
Definition: isl_output.c:50
static __isl_give isl_printer * print_param_tuple(__isl_take isl_printer *p, __isl_keep isl_space *space, struct isl_print_space_data *data)
Definition: isl_output.c:1089
static const char * s_close_set[2]
Definition: isl_output.c:51
const char * p
Definition: isl_test.c:8643
#define PART
These are automatically generated checked C++ bindings for isl.
Definition: ISLTools.h:45
__isl_null isl_printer * isl_printer_free(__isl_take isl_printer *printer)
Definition: isl_printer.c:269
__isl_give isl_printer * isl_printer_print_str(__isl_take isl_printer *p, const char *s)
Definition: isl_printer.c:617
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
Definition: isl_space.c:445
isl_printer * p
Definition: isl_output.c:1616