interface: update to move of llvm/Support/Host.h to llvm/TargetParser/Host.h
[isl.git] / isl_multi_un_op_templ.c
blobbbf105b5927fa7670abffc40aaa07f88014353eb
1 /*
2 * Copyright 2014 Ecole Normale Superieure
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
10 #include <isl_multi_macro.h>
12 /* Apply "fn" to each of the base expressions of "multi".
14 static __isl_give MULTI(BASE) *FN(MULTI(BASE),un_op)(
15 __isl_take MULTI(BASE) *multi, __isl_give EL *(*fn)(__isl_take EL *el))
17 int i;
18 isl_size n;
20 n = FN(MULTI(BASE),size)(multi);
21 if (n < 0)
22 return FN(MULTI(BASE),free)(multi);
24 for (i = 0; i < n; ++i) {
25 EL *el;
27 el = FN(MULTI(BASE),take_at)(multi, i);
28 el = fn(el);
29 multi = FN(MULTI(BASE),restore_at)(multi, i, el);
32 return multi;