Polly 20.0.0git
isl_multi_from_base_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2012,2014 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/space.h>
11
12#include <isl_multi_macro.h>
13
14/* Create a multiple expression with a single output/set dimension
15 * equal to "el".
16 * For most multiple expression types, the base type has a single
17 * output/set dimension and the space of the result is therefore
18 * the same as the space of the input.
19 * In the case of isl_multi_union_pw_aff, however, the base type
20 * lives in a parameter space and we therefore need to add
21 * a single set dimension.
22 */
24{
25 isl_space *space;
26 MULTI(BASE) *multi;
27
28 space = FN(EL,get_space(el));
29 if (isl_space_is_params(space)) {
30 space = isl_space_set_from_params(space);
31 space = isl_space_add_dims(space, isl_dim_set, 1);
32 }
33 multi = FN(MULTI(BASE),alloc)(space);
34 multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
35
36 return multi;
37}
#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)
const char * set
Definition: isl_test.c:1356
__isl_give isl_space * isl_space_set_from_params(__isl_take isl_space *space)
Definition: isl_space.c:2227
isl_bool isl_space_is_params(__isl_keep isl_space *space)
Definition: isl_space.c:179
__isl_give isl_space * isl_space_add_dims(__isl_take isl_space *space, enum isl_dim_type type, unsigned n)
Definition: isl_space.c:1229
@ isl_dim_set
Definition: space_type.h:18