isl_arg.c: drop useless assignments
[isl.git] / isl_obj.c
blob460c123e13c7a23389a00e6a61fb605db1f98a7f
1 /*
2 * Copyright 2010 INRIA Saclay
3 * Copyright 2014 Ecole Normale Superieure
4 * Copyright 2014 INRIA Rocquencourt
6 * Use of this software is governed by the MIT license
8 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
9 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
10 * 91893 Orsay, France
11 * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
12 * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
13 * B.P. 105 - 78153 Le Chesnay, France
16 #include <isl/aff.h>
17 #include <isl/set.h>
18 #include <isl/map.h>
19 #include <isl/polynomial.h>
20 #include <isl/schedule.h>
21 #include <isl/obj.h>
23 static void *isl_obj_val_copy(void *v)
25 return isl_val_copy((isl_val *)v);
28 static void isl_obj_val_free(void *v)
30 isl_val_free((isl_val *)v);
33 static __isl_give isl_printer *isl_obj_val_print(__isl_take isl_printer *p,
34 void *v)
36 return isl_printer_print_val(p, (isl_val *)v);
39 static void *isl_obj_val_add(void *v1, void *v2)
41 return isl_val_add((isl_val *) v1, (isl_val *) v2);
44 struct isl_obj_vtable isl_obj_val_vtable = {
45 isl_obj_val_copy,
46 isl_obj_val_add,
47 isl_obj_val_print,
48 isl_obj_val_free
51 static void *isl_obj_map_copy(void *v)
53 return isl_map_copy((struct isl_map *)v);
56 static void isl_obj_map_free(void *v)
58 isl_map_free((struct isl_map *)v);
61 static __isl_give isl_printer *isl_obj_map_print(__isl_take isl_printer *p,
62 void *v)
64 return isl_printer_print_map(p, (struct isl_map *)v);
67 static void *isl_obj_map_add(void *v1, void *v2)
69 return isl_map_union((struct isl_map *)v1, (struct isl_map *)v2);
72 struct isl_obj_vtable isl_obj_map_vtable = {
73 isl_obj_map_copy,
74 isl_obj_map_add,
75 isl_obj_map_print,
76 isl_obj_map_free
79 static void *isl_obj_union_map_copy(void *v)
81 return isl_union_map_copy((isl_union_map *)v);
84 static void isl_obj_union_map_free(void *v)
86 isl_union_map_free((isl_union_map *)v);
89 static __isl_give isl_printer *isl_obj_union_map_print(__isl_take isl_printer *p,
90 void *v)
92 return isl_printer_print_union_map(p, (isl_union_map *)v);
95 static void *isl_obj_union_map_add(void *v1, void *v2)
97 return isl_union_map_union((isl_union_map *)v1, (isl_union_map *)v2);
100 struct isl_obj_vtable isl_obj_union_map_vtable = {
101 isl_obj_union_map_copy,
102 isl_obj_union_map_add,
103 isl_obj_union_map_print,
104 isl_obj_union_map_free
107 static void *isl_obj_set_copy(void *v)
109 return isl_set_copy((struct isl_set *)v);
112 static void isl_obj_set_free(void *v)
114 isl_set_free((struct isl_set *)v);
117 static __isl_give isl_printer *isl_obj_set_print(__isl_take isl_printer *p,
118 void *v)
120 return isl_printer_print_set(p, (struct isl_set *)v);
123 static void *isl_obj_set_add(void *v1, void *v2)
125 return isl_set_union((struct isl_set *)v1, (struct isl_set *)v2);
128 struct isl_obj_vtable isl_obj_set_vtable = {
129 isl_obj_set_copy,
130 isl_obj_set_add,
131 isl_obj_set_print,
132 isl_obj_set_free
135 static void *isl_obj_union_set_copy(void *v)
137 return isl_union_set_copy((isl_union_set *)v);
140 static void isl_obj_union_set_free(void *v)
142 isl_union_set_free((isl_union_set *)v);
145 static __isl_give isl_printer *isl_obj_union_set_print(__isl_take isl_printer *p,
146 void *v)
148 return isl_printer_print_union_set(p, (isl_union_set *)v);
151 static void *isl_obj_union_set_add(void *v1, void *v2)
153 return isl_union_set_union((isl_union_set *)v1, (isl_union_set *)v2);
156 struct isl_obj_vtable isl_obj_union_set_vtable = {
157 isl_obj_union_set_copy,
158 isl_obj_union_set_add,
159 isl_obj_union_set_print,
160 isl_obj_union_set_free
163 static void *isl_obj_pw_multi_aff_copy(void *v)
165 return isl_pw_multi_aff_copy((isl_pw_multi_aff *) v);
168 static void isl_obj_pw_multi_aff_free(void *v)
170 isl_pw_multi_aff_free((isl_pw_multi_aff *) v);
173 static __isl_give isl_printer *isl_obj_pw_multi_aff_print(
174 __isl_take isl_printer *p, void *v)
176 return isl_printer_print_pw_multi_aff(p, (isl_pw_multi_aff *) v);
179 static void *isl_obj_pw_multi_aff_add(void *v1, void *v2)
181 return isl_pw_multi_aff_add((isl_pw_multi_aff *) v1,
182 (isl_pw_multi_aff *) v2);
185 struct isl_obj_vtable isl_obj_pw_multi_aff_vtable = {
186 isl_obj_pw_multi_aff_copy,
187 isl_obj_pw_multi_aff_add,
188 isl_obj_pw_multi_aff_print,
189 isl_obj_pw_multi_aff_free
192 static void *isl_obj_none_copy(void *v)
194 return v;
197 static void isl_obj_none_free(void *v)
201 static __isl_give isl_printer *isl_obj_none_print(__isl_take isl_printer *p,
202 void *v)
204 return p;
207 static void *isl_obj_none_add(void *v1, void *v2)
209 return NULL;
212 struct isl_obj_vtable isl_obj_none_vtable = {
213 isl_obj_none_copy,
214 isl_obj_none_add,
215 isl_obj_none_print,
216 isl_obj_none_free
219 static void *isl_obj_pw_qp_copy(void *v)
221 return isl_pw_qpolynomial_copy((struct isl_pw_qpolynomial *)v);
224 static void isl_obj_pw_qp_free(void *v)
226 isl_pw_qpolynomial_free((struct isl_pw_qpolynomial *)v);
229 static __isl_give isl_printer *isl_obj_pw_qp_print(__isl_take isl_printer *p,
230 void *v)
232 return isl_printer_print_pw_qpolynomial(p,
233 (struct isl_pw_qpolynomial *)v);
236 static void *isl_obj_pw_qp_add(void *v1, void *v2)
238 return isl_pw_qpolynomial_add((struct isl_pw_qpolynomial *)v1,
239 (struct isl_pw_qpolynomial *)v2);
242 struct isl_obj_vtable isl_obj_pw_qpolynomial_vtable = {
243 isl_obj_pw_qp_copy,
244 isl_obj_pw_qp_add,
245 isl_obj_pw_qp_print,
246 isl_obj_pw_qp_free
249 static void *isl_obj_union_pw_qp_copy(void *v)
251 return isl_union_pw_qpolynomial_copy((struct isl_union_pw_qpolynomial *)v);
254 static void isl_obj_union_pw_qp_free(void *v)
256 isl_union_pw_qpolynomial_free((struct isl_union_pw_qpolynomial *)v);
259 static __isl_give isl_printer *isl_obj_union_pw_qp_print(
260 __isl_take isl_printer *p, void *v)
262 return isl_printer_print_union_pw_qpolynomial(p,
263 (struct isl_union_pw_qpolynomial *)v);
266 static void *isl_obj_union_pw_qp_add(void *v1, void *v2)
268 return isl_union_pw_qpolynomial_add(
269 (struct isl_union_pw_qpolynomial *)v1,
270 (struct isl_union_pw_qpolynomial *)v2);
273 struct isl_obj_vtable isl_obj_union_pw_qpolynomial_vtable = {
274 isl_obj_union_pw_qp_copy,
275 isl_obj_union_pw_qp_add,
276 isl_obj_union_pw_qp_print,
277 isl_obj_union_pw_qp_free
280 static void *isl_obj_pw_qpf_copy(void *v)
282 return isl_pw_qpolynomial_fold_copy((struct isl_pw_qpolynomial_fold *)v);
285 static void isl_obj_pw_qpf_free(void *v)
287 isl_pw_qpolynomial_fold_free((struct isl_pw_qpolynomial_fold *)v);
290 static __isl_give isl_printer *isl_obj_pw_qpf_print(__isl_take isl_printer *p,
291 void *v)
293 return isl_printer_print_pw_qpolynomial_fold(p,
294 (struct isl_pw_qpolynomial_fold *)v);
297 static void *isl_obj_pw_qpf_add(void *v1, void *v2)
299 return isl_pw_qpolynomial_fold_fold((struct isl_pw_qpolynomial_fold *)v1,
300 (struct isl_pw_qpolynomial_fold *)v2);
303 struct isl_obj_vtable isl_obj_pw_qpolynomial_fold_vtable = {
304 isl_obj_pw_qpf_copy,
305 isl_obj_pw_qpf_add,
306 isl_obj_pw_qpf_print,
307 isl_obj_pw_qpf_free
310 static void *isl_obj_union_pw_qpf_copy(void *v)
312 return isl_union_pw_qpolynomial_fold_copy((struct isl_union_pw_qpolynomial_fold *)v);
315 static void isl_obj_union_pw_qpf_free(void *v)
317 isl_union_pw_qpolynomial_fold_free((struct isl_union_pw_qpolynomial_fold *)v);
320 static __isl_give isl_printer *isl_obj_union_pw_qpf_print(
321 __isl_take isl_printer *p, void *v)
323 return isl_printer_print_union_pw_qpolynomial_fold(p,
324 (struct isl_union_pw_qpolynomial_fold *)v);
327 static void *isl_obj_union_pw_qpf_add(void *v1, void *v2)
329 return isl_union_pw_qpolynomial_fold_fold(
330 (struct isl_union_pw_qpolynomial_fold *)v1,
331 (struct isl_union_pw_qpolynomial_fold *)v2);
334 struct isl_obj_vtable isl_obj_union_pw_qpolynomial_fold_vtable = {
335 isl_obj_union_pw_qpf_copy,
336 isl_obj_union_pw_qpf_add,
337 isl_obj_union_pw_qpf_print,
338 isl_obj_union_pw_qpf_free
341 static void *isl_obj_schedule_copy(void *v)
343 return isl_schedule_copy((isl_schedule *) v);
346 static void isl_obj_schedule_free(void *v)
348 isl_schedule_free((isl_schedule *) v);
351 static __isl_give isl_printer *isl_obj_schedule_print(
352 __isl_take isl_printer *p, void *v)
354 return isl_printer_print_schedule(p, (isl_schedule *) v);
357 struct isl_obj_vtable isl_obj_schedule_vtable = {
358 isl_obj_schedule_copy,
359 NULL,
360 isl_obj_schedule_print,
361 isl_obj_schedule_free