Polly 19.0.0git
isl_multi_domain_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2013 Ecole Normale Superieure
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
9
10#include <isl/set.h>
11
12#include <isl_multi_macro.h>
13
14/* Return the shared domain of the elements of "multi".
15 *
16 * If "multi" has an explicit domain, then return this domain.
17 */
19{
20 int i;
21 isl_set *dom;
22
23 if (!multi)
24 return NULL;
25
26 if (FN(MULTI(BASE),has_explicit_domain)(multi)) {
27 dom = FN(MULTI(BASE),get_explicit_domain)(multi);
28 FN(MULTI(BASE),free)(multi);
29 return dom;
30 }
31
32 dom = isl_set_universe(FN(MULTI(BASE),get_domain_space)(multi));
33 for (i = 0; i < multi->n; ++i) {
34 isl_set *dom_i;
35
36 dom_i = FN(EL,domain)(FN(FN(MULTI(BASE),get),BASE)(multi, i));
37 dom = isl_set_intersect(dom, dom_i);
38 }
39
40 FN(MULTI(BASE),free)(multi);
41 return dom;
42}
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
#define BASE
Definition: flow_cmp.c:49
#define EL
#define MULTI(BASE)
struct isl_set isl_set
Definition: map_type.h:26
__isl_export __isl_give isl_set * isl_set_universe(__isl_take isl_space *space)
Definition: isl_map.c:6366
__isl_export __isl_give isl_set * isl_set_intersect(__isl_take isl_set *set1, __isl_take isl_set *set2)
Definition: isl_map.c:3965
static Signature domain