/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/lib/External/isl/include/isl/ctx.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2008-2009 Katholieke Universiteit Leuven |
3 | | * |
4 | | * Use of this software is governed by the MIT license |
5 | | * |
6 | | * Written by Sven Verdoolaege, K.U.Leuven, Departement |
7 | | * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium |
8 | | */ |
9 | | |
10 | | #ifndef ISL_CTX_H |
11 | | #define ISL_CTX_H |
12 | | |
13 | | #include <stdio.h> |
14 | | #include <stdlib.h> |
15 | | |
16 | | #include <isl/arg.h> |
17 | | |
18 | | #ifndef __isl_give |
19 | | #define __isl_give |
20 | | #endif |
21 | | #ifndef __isl_take |
22 | | #define __isl_take |
23 | | #endif |
24 | | #ifndef __isl_keep |
25 | | #define __isl_keep |
26 | | #endif |
27 | | #ifndef __isl_null |
28 | | #define __isl_null |
29 | | #endif |
30 | | #ifndef __isl_export |
31 | | #define __isl_export |
32 | | #endif |
33 | | #ifndef __isl_overload |
34 | | #define __isl_overload |
35 | | #endif |
36 | | #ifndef __isl_constructor |
37 | | #define __isl_constructor |
38 | | #endif |
39 | | #ifndef __isl_subclass |
40 | | #define __isl_subclass(super) |
41 | | #endif |
42 | | |
43 | | #if defined(__cplusplus) |
44 | | extern "C" { |
45 | | #endif |
46 | | |
47 | | /* Nearly all isa functions require a struct isl_ctx allocated using |
48 | | * isl_ctx_alloc. This ctx contains (or will contain) options that |
49 | | * control the behavior of the library and some caches. |
50 | | * |
51 | | * An object allocated within a given ctx should never be used inside |
52 | | * another ctx. Functions for moving objects from one ctx to another |
53 | | * will be added as the need arises. |
54 | | * |
55 | | * A given context should only be used inside a single thread. |
56 | | * A global context for synchronization between different threads |
57 | | * as well as functions for moving a context to a different thread |
58 | | * will be added as the need arises. |
59 | | * |
60 | | * If anything goes wrong (out of memory, failed assertion), then |
61 | | * the library will currently simply abort. This will be made |
62 | | * configurable in the future. |
63 | | * Users of the library should expect functions that return |
64 | | * a pointer to a structure, to return NULL, indicating failure. |
65 | | * Any function accepting a pointer to a structure will treat |
66 | | * a NULL argument as a failure, resulting in the function freeing |
67 | | * the remaining structures (if any) and returning NULL itself |
68 | | * (in case of pointer return type). |
69 | | * The only exception is the isl_ctx argument, which should never be NULL. |
70 | | */ |
71 | | struct isl_stats { |
72 | | long gbr_solved_lps; |
73 | | }; |
74 | | enum isl_error { |
75 | | isl_error_none = 0, |
76 | | isl_error_abort, |
77 | | isl_error_alloc, |
78 | | isl_error_unknown, |
79 | | isl_error_internal, |
80 | | isl_error_invalid, |
81 | | isl_error_quota, |
82 | | isl_error_unsupported |
83 | | }; |
84 | | typedef enum { |
85 | | isl_stat_error = -1, |
86 | | isl_stat_ok = 0 |
87 | | } isl_stat; |
88 | | typedef enum { |
89 | | isl_bool_error = -1, |
90 | | isl_bool_false = 0, |
91 | | isl_bool_true = 1 |
92 | | } isl_bool; |
93 | | isl_bool isl_bool_not(isl_bool b); |
94 | | struct isl_ctx; |
95 | | typedef struct isl_ctx isl_ctx; |
96 | | |
97 | | /* Some helper macros */ |
98 | | |
99 | | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) |
100 | | #define ISL_DEPRECATED __attribute__((__deprecated__)) |
101 | | #else |
102 | | #define ISL_DEPRECATED |
103 | | #endif |
104 | | |
105 | | #define ISL_FL_INIT(l, f) (l) = (f) /* Specific flags location. */ |
106 | 21.7M | #define ISL_FL_SET(l, f) ((l) |= (f)) |
107 | 250M | #define ISL_FL_CLR(l, f) ((l) &= ~(f)) |
108 | 96.3M | #define ISL_FL_ISSET(l, f) (!!((l) & (f))) |
109 | | |
110 | | #define ISL_F_INIT(p, f) ISL_FL_INIT((p)->flags, f) /* Structure element flags. */ |
111 | 13.6M | #define ISL_F_SET(p, f) ISL_FL_SET((p)->flags, f) |
112 | 245M | #define ISL_F_CLR(p, f) ISL_FL_CLR((p)->flags, f) |
113 | 93.3M | #define ISL_F_ISSET(p, f) ISL_FL_ISSET((p)->flags, f) |
114 | | |
115 | | void *isl_malloc_or_die(isl_ctx *ctx, size_t size); |
116 | | void *isl_calloc_or_die(isl_ctx *ctx, size_t nmemb, size_t size); |
117 | | void *isl_realloc_or_die(isl_ctx *ctx, void *ptr, size_t size); |
118 | | |
119 | 67.5M | #define isl_alloc(ctx,type,size) ((type *)isl_malloc_or_die(ctx, size)) |
120 | 11.5M | #define isl_calloc(ctx,type,size) ((type *)isl_calloc_or_die(ctx,\ |
121 | 11.5M | 1, size)) |
122 | 2.24M | #define isl_realloc(ctx,ptr,type,size) ((type *)isl_realloc_or_die(ctx,\ |
123 | 2.24M | ptr, size)) |
124 | 34.4M | #define isl_alloc_type(ctx,type) isl_alloc(ctx,type,sizeof(type)) |
125 | 9.63M | #define isl_calloc_type(ctx,type) isl_calloc(ctx,type,sizeof(type)) |
126 | | #define isl_realloc_type(ctx,ptr,type) isl_realloc(ctx,ptr,type,sizeof(type)) |
127 | 31.7M | #define isl_alloc_array(ctx,type,n) isl_alloc(ctx,type,(n)*sizeof(type)) |
128 | 6.59M | #define isl_calloc_array(ctx,type,n) ((type *)isl_calloc_or_die(ctx,\ |
129 | 6.59M | n, sizeof(type))) |
130 | | #define isl_realloc_array(ctx,ptr,type,n) \ |
131 | 2.23M | isl_realloc(ctx,ptr,type,(n)*sizeof(type)) |
132 | | |
133 | | #define isl_die(ctx,errno,msg,code) \ |
134 | 111 | do { \ |
135 | 111 | isl_handle_error(ctx, errno, msg, __FILE__, __LINE__); \ |
136 | 111 | code; \ |
137 | 111 | } while (00 ) |
138 | | |
139 | | void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg, |
140 | | const char *file, int line); |
141 | | |
142 | | #define isl_assert4(ctx,test,code,errno) \ |
143 | 268M | do { \ |
144 | 239M | if (test) \ |
145 | 239M | break; \ |
146 | 239M | isl_die0 (ctx, errno, "Assertion \"" #test "\" failed", code); \ |
147 | 0 | } while (0) |
148 | | #define isl_assert(ctx,test,code) \ |
149 | 239M | isl_assert4(ctx,test,code,isl_error_unknown) |
150 | | |
151 | 44.2M | #define isl_min(a,b) ((a < b) ? (a)0 : (b)) |
152 | | |
153 | | /* struct isl_ctx functions */ |
154 | | |
155 | | struct isl_options *isl_ctx_options(isl_ctx *ctx); |
156 | | |
157 | | isl_ctx *isl_ctx_alloc_with_options(struct isl_args *args, |
158 | | __isl_take void *opt); |
159 | | isl_ctx *isl_ctx_alloc(void); |
160 | | void *isl_ctx_peek_options(isl_ctx *ctx, struct isl_args *args); |
161 | | int isl_ctx_parse_options(isl_ctx *ctx, int argc, char **argv, unsigned flags); |
162 | | void isl_ctx_ref(struct isl_ctx *ctx); |
163 | | void isl_ctx_deref(struct isl_ctx *ctx); |
164 | | void isl_ctx_free(isl_ctx *ctx); |
165 | | |
166 | | void isl_ctx_abort(isl_ctx *ctx); |
167 | | void isl_ctx_resume(isl_ctx *ctx); |
168 | | int isl_ctx_aborted(isl_ctx *ctx); |
169 | | |
170 | | void isl_ctx_set_max_operations(isl_ctx *ctx, unsigned long max_operations); |
171 | | unsigned long isl_ctx_get_max_operations(isl_ctx *ctx); |
172 | | void isl_ctx_reset_operations(isl_ctx *ctx); |
173 | | |
174 | | #define ISL_ARG_CTX_DECL(prefix,st,args) \ |
175 | | st *isl_ctx_peek_ ## prefix(isl_ctx *ctx); |
176 | | |
177 | | #define ISL_ARG_CTX_DEF(prefix,st,args) \ |
178 | 58.1k | st *isl_ctx_peek_ ## prefix(isl_ctx *ctx) \ |
179 | 58.1k | { \ |
180 | 58.1k | return (st *)isl_ctx_peek_options(ctx, &(args)); \ |
181 | 58.1k | } |
182 | | |
183 | | #define ISL_CTX_GET_INT_DEF(prefix,st,args,field) \ |
184 | 46.6k | int prefix ## _get_ ## field(isl_ctx *ctx) \ |
185 | 46.6k | { \ |
186 | 46.6k | st *options; \ |
187 | 46.6k | options = isl_ctx_peek_ ## prefix(ctx); \ |
188 | 46.6k | if (!options) \ |
189 | 46.6k | isl_die0 (ctx, isl_error_invalid, \ |
190 | 46.6k | "isl_ctx does not reference " #prefix, \ |
191 | 46.6k | return -1); \ |
192 | 46.6k | return options->field; \ |
193 | 46.6k | } Unexecuted instantiation: isl_options_get_bound Line | Count | Source | 184 | 1.15k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 1.15k | { \ | 186 | 1.15k | st *options; \ | 187 | 1.15k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 1.15k | if (!options) \ | 189 | 1.15k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 1.15k | "isl_ctx does not reference " #prefix, \ | 191 | 1.15k | return -1); \ | 192 | 1.15k | return options->field; \ | 193 | 1.15k | } |
Unexecuted instantiation: isl_options_get_pip_symmetry isl_options_get_coalesce_bounded_wrapping Line | Count | Source | 184 | 6.57k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 6.57k | { \ | 186 | 6.57k | st *options; \ | 187 | 6.57k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 6.57k | if (!options) \ | 189 | 6.57k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 6.57k | "isl_ctx does not reference " #prefix, \ | 191 | 6.57k | return -1); \ | 192 | 6.57k | return options->field; \ | 193 | 6.57k | } |
isl_options_get_coalesce_preserve_locals Line | Count | Source | 184 | 11.3k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 11.3k | { \ | 186 | 11.3k | st *options; \ | 187 | 11.3k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 11.3k | if (!options) \ | 189 | 11.3k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 11.3k | "isl_ctx does not reference " #prefix, \ | 191 | 11.3k | return -1); \ | 192 | 11.3k | return options->field; \ | 193 | 11.3k | } |
Unexecuted instantiation: isl_options_get_gbr_only_first isl_options_get_schedule_max_coefficient Line | Count | Source | 184 | 1.09k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 1.09k | { \ | 186 | 1.09k | st *options; \ | 187 | 1.09k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 1.09k | if (!options) \ | 189 | 1.09k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 1.09k | "isl_ctx does not reference " #prefix, \ | 191 | 1.09k | return -1); \ | 192 | 1.09k | return options->field; \ | 193 | 1.09k | } |
isl_options_get_schedule_max_constant_term Line | Count | Source | 184 | 810 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 810 | { \ | 186 | 810 | st *options; \ | 187 | 810 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 810 | if (!options) \ | 189 | 810 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 810 | "isl_ctx does not reference " #prefix, \ | 191 | 810 | return -1); \ | 192 | 810 | return options->field; \ | 193 | 810 | } |
isl_options_get_schedule_maximize_band_depth Line | Count | Source | 184 | 18 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 18 | { \ | 186 | 18 | st *options; \ | 187 | 18 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 18 | if (!options) \ | 189 | 18 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 18 | "isl_ctx does not reference " #prefix, \ | 191 | 18 | return -1); \ | 192 | 18 | return options->field; \ | 193 | 18 | } |
isl_options_get_schedule_maximize_coincidence Line | Count | Source | 184 | 20 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 20 | { \ | 186 | 20 | st *options; \ | 187 | 20 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 20 | if (!options) \ | 189 | 20 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 20 | "isl_ctx does not reference " #prefix, \ | 191 | 20 | return -1); \ | 192 | 20 | return options->field; \ | 193 | 20 | } |
Unexecuted instantiation: isl_options_get_schedule_split_scaled isl_options_get_schedule_treat_coalescing Line | Count | Source | 184 | 1.55k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 1.55k | { \ | 186 | 1.55k | st *options; \ | 187 | 1.55k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 1.55k | if (!options) \ | 189 | 1.55k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 1.55k | "isl_ctx does not reference " #prefix, \ | 191 | 1.55k | return -1); \ | 192 | 1.55k | return options->field; \ | 193 | 1.55k | } |
isl_options_get_schedule_separate_components Line | Count | Source | 184 | 10 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 10 | { \ | 186 | 10 | st *options; \ | 187 | 10 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 10 | if (!options) \ | 189 | 10 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 10 | "isl_ctx does not reference " #prefix, \ | 191 | 10 | return -1); \ | 192 | 10 | return options->field; \ | 193 | 10 | } |
isl_options_get_schedule_whole_component Line | Count | Source | 184 | 67 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 67 | { \ | 186 | 67 | st *options; \ | 187 | 67 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 67 | if (!options) \ | 189 | 67 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 67 | "isl_ctx does not reference " #prefix, \ | 191 | 67 | return -1); \ | 192 | 67 | return options->field; \ | 193 | 67 | } |
isl_options_get_schedule_outer_coincidence Line | Count | Source | 184 | 12 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 12 | { \ | 186 | 12 | st *options; \ | 187 | 12 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 12 | if (!options) \ | 189 | 12 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 12 | "isl_ctx does not reference " #prefix, \ | 191 | 12 | return -1); \ | 192 | 12 | return options->field; \ | 193 | 12 | } |
Unexecuted instantiation: isl_options_get_schedule_algorithm isl_options_get_schedule_carry_self_first Line | Count | Source | 184 | 10 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 10 | { \ | 186 | 10 | st *options; \ | 187 | 10 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 10 | if (!options) \ | 189 | 10 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 10 | "isl_ctx does not reference " #prefix, \ | 191 | 10 | return -1); \ | 192 | 10 | return options->field; \ | 193 | 10 | } |
isl_options_get_schedule_serialize_sccs Line | Count | Source | 184 | 288 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 288 | { \ | 186 | 288 | st *options; \ | 187 | 288 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 288 | if (!options) \ | 189 | 288 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 288 | "isl_ctx does not reference " #prefix, \ | 191 | 288 | return -1); \ | 192 | 288 | return options->field; \ | 193 | 288 | } |
isl_options_get_tile_scale_tile_loops Line | Count | Source | 184 | 159 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 159 | { \ | 186 | 159 | st *options; \ | 187 | 159 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 159 | if (!options) \ | 189 | 159 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 159 | "isl_ctx does not reference " #prefix, \ | 191 | 159 | return -1); \ | 192 | 159 | return options->field; \ | 193 | 159 | } |
isl_options_get_tile_shift_point_loops Line | Count | Source | 184 | 81 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 81 | { \ | 186 | 81 | st *options; \ | 187 | 81 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 81 | if (!options) \ | 189 | 81 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 81 | "isl_ctx does not reference " #prefix, \ | 191 | 81 | return -1); \ | 192 | 81 | return options->field; \ | 193 | 81 | } |
isl_options_get_ast_build_atomic_upper_bound Line | Count | Source | 184 | 749 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 749 | { \ | 186 | 749 | st *options; \ | 187 | 749 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 749 | if (!options) \ | 189 | 749 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 749 | "isl_ctx does not reference " #prefix, \ | 191 | 749 | return -1); \ | 192 | 749 | return options->field; \ | 193 | 749 | } |
isl_options_get_ast_build_prefer_pdiv Line | Count | Source | 184 | 9.16k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 9.16k | { \ | 186 | 9.16k | st *options; \ | 187 | 9.16k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 9.16k | if (!options) \ | 189 | 9.16k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 9.16k | "isl_ctx does not reference " #prefix, \ | 191 | 9.16k | return -1); \ | 192 | 9.16k | return options->field; \ | 193 | 9.16k | } |
isl_options_get_ast_build_detect_min_max Line | Count | Source | 184 | 55 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 55 | { \ | 186 | 55 | st *options; \ | 187 | 55 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 55 | if (!options) \ | 189 | 55 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 55 | "isl_ctx does not reference " #prefix, \ | 191 | 55 | return -1); \ | 192 | 55 | return options->field; \ | 193 | 55 | } |
isl_options_get_ast_build_exploit_nested_bounds Line | Count | Source | 184 | 4.06k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 4.06k | { \ | 186 | 4.06k | st *options; \ | 187 | 4.06k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 4.06k | if (!options) \ | 189 | 4.06k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 4.06k | "isl_ctx does not reference " #prefix, \ | 191 | 4.06k | return -1); \ | 192 | 4.06k | return options->field; \ | 193 | 4.06k | } |
isl_options_get_ast_build_group_coscheduled Line | Count | Source | 184 | 153 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 153 | { \ | 186 | 153 | st *options; \ | 187 | 153 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 153 | if (!options) \ | 189 | 153 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 153 | "isl_ctx does not reference " #prefix, \ | 191 | 153 | return -1); \ | 192 | 153 | return options->field; \ | 193 | 153 | } |
isl_options_get_ast_always_print_block Line | Count | Source | 184 | 355 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 355 | { \ | 186 | 355 | st *options; \ | 187 | 355 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 355 | if (!options) \ | 189 | 355 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 355 | "isl_ctx does not reference " #prefix, \ | 191 | 355 | return -1); \ | 192 | 355 | return options->field; \ | 193 | 355 | } |
Unexecuted instantiation: isl_options_get_ast_print_macro_once isl_options_get_ast_build_separation_bounds Line | Count | Source | 184 | 27 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 27 | { \ | 186 | 27 | st *options; \ | 187 | 27 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 27 | if (!options) \ | 189 | 27 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 27 | "isl_ctx does not reference " #prefix, \ | 191 | 27 | return -1); \ | 192 | 27 | return options->field; \ | 193 | 27 | } |
isl_options_get_ast_build_scale_strides Line | Count | Source | 184 | 4.06k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 4.06k | { \ | 186 | 4.06k | st *options; \ | 187 | 4.06k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 4.06k | if (!options) \ | 189 | 4.06k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 4.06k | "isl_ctx does not reference " #prefix, \ | 191 | 4.06k | return -1); \ | 192 | 4.06k | return options->field; \ | 193 | 4.06k | } |
isl_options_get_ast_build_allow_else Line | Count | Source | 184 | 4.59k | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 4.59k | { \ | 186 | 4.59k | st *options; \ | 187 | 4.59k | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 4.59k | if (!options) \ | 189 | 4.59k | isl_die0 (ctx, isl_error_invalid, \ | 190 | 4.59k | "isl_ctx does not reference " #prefix, \ | 191 | 4.59k | return -1); \ | 192 | 4.59k | return options->field; \ | 193 | 4.59k | } |
isl_options_get_ast_build_allow_or Line | Count | Source | 184 | 241 | int prefix ## _get_ ## field(isl_ctx *ctx) \ | 185 | 241 | { \ | 186 | 241 | st *options; \ | 187 | 241 | options = isl_ctx_peek_ ## prefix(ctx); \ | 188 | 241 | if (!options) \ | 189 | 241 | isl_die0 (ctx, isl_error_invalid, \ | 190 | 241 | "isl_ctx does not reference " #prefix, \ | 191 | 241 | return -1); \ | 192 | 241 | return options->field; \ | 193 | 241 | } |
|
194 | | |
195 | | #define ISL_CTX_SET_INT_DEF(prefix,st,args,field) \ |
196 | 11.0k | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ |
197 | 11.0k | { \ |
198 | 11.0k | st *options; \ |
199 | 11.0k | options = isl_ctx_peek_ ## prefix(ctx); \ |
200 | 11.0k | if (!options) \ |
201 | 11.0k | isl_die0 (ctx, isl_error_invalid, \ |
202 | 11.0k | "isl_ctx does not reference " #prefix, \ |
203 | 11.0k | return isl_stat_error); \ |
204 | 11.0k | options->field = val; \ |
205 | 11.0k | return isl_stat_ok; \ |
206 | 11.0k | } Unexecuted instantiation: isl_options_set_bound Line | Count | Source | 196 | 3.51k | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 3.51k | { \ | 198 | 3.51k | st *options; \ | 199 | 3.51k | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 3.51k | if (!options) \ | 201 | 3.51k | isl_die0 (ctx, isl_error_invalid, \ | 202 | 3.51k | "isl_ctx does not reference " #prefix, \ | 203 | 3.51k | return isl_stat_error); \ | 204 | 3.51k | options->field = val; \ | 205 | 3.51k | return isl_stat_ok; \ | 206 | 3.51k | } |
Unexecuted instantiation: isl_options_set_pip_symmetry isl_options_set_coalesce_bounded_wrapping Line | Count | Source | 196 | 2 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 2 | { \ | 198 | 2 | st *options; \ | 199 | 2 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 2 | if (!options) \ | 201 | 2 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 2 | "isl_ctx does not reference " #prefix, \ | 203 | 2 | return isl_stat_error); \ | 204 | 2 | options->field = val; \ | 205 | 2 | return isl_stat_ok; \ | 206 | 2 | } |
isl_options_set_coalesce_preserve_locals Line | Count | Source | 196 | 6.38k | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 6.38k | { \ | 198 | 6.38k | st *options; \ | 199 | 6.38k | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 6.38k | if (!options) \ | 201 | 6.38k | isl_die0 (ctx, isl_error_invalid, \ | 202 | 6.38k | "isl_ctx does not reference " #prefix, \ | 203 | 6.38k | return isl_stat_error); \ | 204 | 6.38k | options->field = val; \ | 205 | 6.38k | return isl_stat_ok; \ | 206 | 6.38k | } |
Unexecuted instantiation: isl_options_set_gbr_only_first isl_options_set_schedule_max_coefficient Line | Count | Source | 196 | 40 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 40 | { \ | 198 | 40 | st *options; \ | 199 | 40 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 40 | if (!options) \ | 201 | 40 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 40 | "isl_ctx does not reference " #prefix, \ | 203 | 40 | return isl_stat_error); \ | 204 | 40 | options->field = val; \ | 205 | 40 | return isl_stat_ok; \ | 206 | 40 | } |
isl_options_set_schedule_max_constant_term Line | Count | Source | 196 | 40 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 40 | { \ | 198 | 40 | st *options; \ | 199 | 40 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 40 | if (!options) \ | 201 | 40 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 40 | "isl_ctx does not reference " #prefix, \ | 203 | 40 | return isl_stat_error); \ | 204 | 40 | options->field = val; \ | 205 | 40 | return isl_stat_ok; \ | 206 | 40 | } |
isl_options_set_schedule_maximize_band_depth Line | Count | Source | 196 | 40 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 40 | { \ | 198 | 40 | st *options; \ | 199 | 40 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 40 | if (!options) \ | 201 | 40 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 40 | "isl_ctx does not reference " #prefix, \ | 203 | 40 | return isl_stat_error); \ | 204 | 40 | options->field = val; \ | 205 | 40 | return isl_stat_ok; \ | 206 | 40 | } |
isl_options_set_schedule_maximize_coincidence Line | Count | Source | 196 | 4 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 4 | { \ | 198 | 4 | st *options; \ | 199 | 4 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 4 | if (!options) \ | 201 | 4 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 4 | "isl_ctx does not reference " #prefix, \ | 203 | 4 | return isl_stat_error); \ | 204 | 4 | options->field = val; \ | 205 | 4 | return isl_stat_ok; \ | 206 | 4 | } |
Unexecuted instantiation: isl_options_set_schedule_split_scaled isl_options_set_schedule_treat_coalescing Line | Count | Source | 196 | 8 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 8 | { \ | 198 | 8 | st *options; \ | 199 | 8 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 8 | if (!options) \ | 201 | 8 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 8 | "isl_ctx does not reference " #prefix, \ | 203 | 8 | return isl_stat_error); \ | 204 | 8 | options->field = val; \ | 205 | 8 | return isl_stat_ok; \ | 206 | 8 | } |
Unexecuted instantiation: isl_options_set_schedule_separate_components isl_options_set_schedule_whole_component Line | Count | Source | 196 | 4 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 4 | { \ | 198 | 4 | st *options; \ | 199 | 4 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 4 | if (!options) \ | 201 | 4 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 4 | "isl_ctx does not reference " #prefix, \ | 203 | 4 | return isl_stat_error); \ | 204 | 4 | options->field = val; \ | 205 | 4 | return isl_stat_ok; \ | 206 | 4 | } |
isl_options_set_schedule_outer_coincidence Line | Count | Source | 196 | 40 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 40 | { \ | 198 | 40 | st *options; \ | 199 | 40 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 40 | if (!options) \ | 201 | 40 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 40 | "isl_ctx does not reference " #prefix, \ | 203 | 40 | return isl_stat_error); \ | 204 | 40 | options->field = val; \ | 205 | 40 | return isl_stat_ok; \ | 206 | 40 | } |
Unexecuted instantiation: isl_options_set_schedule_algorithm Unexecuted instantiation: isl_options_set_schedule_carry_self_first isl_options_set_schedule_serialize_sccs Line | Count | Source | 196 | 40 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 40 | { \ | 198 | 40 | st *options; \ | 199 | 40 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 40 | if (!options) \ | 201 | 40 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 40 | "isl_ctx does not reference " #prefix, \ | 203 | 40 | return isl_stat_error); \ | 204 | 40 | options->field = val; \ | 205 | 40 | return isl_stat_ok; \ | 206 | 40 | } |
isl_options_set_tile_scale_tile_loops Line | Count | Source | 196 | 45 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 45 | { \ | 198 | 45 | st *options; \ | 199 | 45 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 45 | if (!options) \ | 201 | 45 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 45 | "isl_ctx does not reference " #prefix, \ | 203 | 45 | return isl_stat_error); \ | 204 | 45 | options->field = val; \ | 205 | 45 | return isl_stat_ok; \ | 206 | 45 | } |
isl_options_set_tile_shift_point_loops Line | Count | Source | 196 | 5 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 5 | { \ | 198 | 5 | st *options; \ | 199 | 5 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 5 | if (!options) \ | 201 | 5 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 5 | "isl_ctx does not reference " #prefix, \ | 203 | 5 | return isl_stat_error); \ | 204 | 5 | options->field = val; \ | 205 | 5 | return isl_stat_ok; \ | 206 | 5 | } |
isl_options_set_ast_build_atomic_upper_bound Line | Count | Source | 196 | 458 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 458 | { \ | 198 | 458 | st *options; \ | 199 | 458 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 458 | if (!options) \ | 201 | 458 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 458 | "isl_ctx does not reference " #prefix, \ | 203 | 458 | return isl_stat_error); \ | 204 | 458 | options->field = val; \ | 205 | 458 | return isl_stat_ok; \ | 206 | 458 | } |
Unexecuted instantiation: isl_options_set_ast_build_prefer_pdiv isl_options_set_ast_build_detect_min_max Line | Count | Source | 196 | 460 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 460 | { \ | 198 | 460 | st *options; \ | 199 | 460 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 460 | if (!options) \ | 201 | 460 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 460 | "isl_ctx does not reference " #prefix, \ | 203 | 460 | return isl_stat_error); \ | 204 | 460 | options->field = val; \ | 205 | 460 | return isl_stat_ok; \ | 206 | 460 | } |
isl_options_set_ast_build_exploit_nested_bounds Line | Count | Source | 196 | 3 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ | 197 | 3 | { \ | 198 | 3 | st *options; \ | 199 | 3 | options = isl_ctx_peek_ ## prefix(ctx); \ | 200 | 3 | if (!options) \ | 201 | 3 | isl_die0 (ctx, isl_error_invalid, \ | 202 | 3 | "isl_ctx does not reference " #prefix, \ | 203 | 3 | return isl_stat_error); \ | 204 | 3 | options->field = val; \ | 205 | 3 | return isl_stat_ok; \ | 206 | 3 | } |
Unexecuted instantiation: isl_options_set_ast_build_group_coscheduled Unexecuted instantiation: isl_options_set_ast_always_print_block Unexecuted instantiation: isl_options_set_ast_print_macro_once Unexecuted instantiation: isl_options_set_ast_build_separation_bounds Unexecuted instantiation: isl_options_set_ast_build_scale_strides Unexecuted instantiation: isl_options_set_ast_build_allow_else Unexecuted instantiation: isl_options_set_ast_build_allow_or |
207 | | |
208 | | #define ISL_CTX_GET_STR_DEF(prefix,st,args,field) \ |
209 | 424 | const char *prefix ## _get_ ## field(isl_ctx *ctx) \ |
210 | 424 | { \ |
211 | 424 | st *options; \ |
212 | 424 | options = isl_ctx_peek_ ## prefix(ctx); \ |
213 | 424 | if (!options) \ |
214 | 424 | isl_die0 (ctx, isl_error_invalid, \ |
215 | 424 | "isl_ctx does not reference " #prefix, \ |
216 | 424 | return NULL); \ |
217 | 424 | return options->field; \ |
218 | 424 | } |
219 | | |
220 | | #define ISL_CTX_SET_STR_DEF(prefix,st,args,field) \ |
221 | 0 | isl_stat prefix ## _set_ ## field(isl_ctx *ctx, const char *val) \ |
222 | 0 | { \ |
223 | 0 | st *options; \ |
224 | 0 | options = isl_ctx_peek_ ## prefix(ctx); \ |
225 | 0 | if (!options) \ |
226 | 0 | isl_die(ctx, isl_error_invalid, \ |
227 | 0 | "isl_ctx does not reference " #prefix, \ |
228 | 0 | return isl_stat_error); \ |
229 | 0 | if (!val) \ |
230 | 0 | return isl_stat_error; \ |
231 | 0 | free(options->field); \ |
232 | 0 | options->field = strdup(val); \ |
233 | 0 | if (!options->field) \ |
234 | 0 | return isl_stat_error; \ |
235 | 0 | return isl_stat_ok; \ |
236 | 0 | } |
237 | | |
238 | | #define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field) \ |
239 | | ISL_CTX_GET_INT_DEF(prefix,st,args,field) |
240 | | |
241 | | #define ISL_CTX_SET_BOOL_DEF(prefix,st,args,field) \ |
242 | | ISL_CTX_SET_INT_DEF(prefix,st,args,field) |
243 | | |
244 | | #define ISL_CTX_GET_CHOICE_DEF(prefix,st,args,field) \ |
245 | | ISL_CTX_GET_INT_DEF(prefix,st,args,field) |
246 | | |
247 | | #define ISL_CTX_SET_CHOICE_DEF(prefix,st,args,field) \ |
248 | | ISL_CTX_SET_INT_DEF(prefix,st,args,field) |
249 | | |
250 | | enum isl_error isl_ctx_last_error(isl_ctx *ctx); |
251 | | const char *isl_ctx_last_error_msg(isl_ctx *ctx); |
252 | | const char *isl_ctx_last_error_file(isl_ctx *ctx); |
253 | | int isl_ctx_last_error_line(isl_ctx *ctx); |
254 | | void isl_ctx_reset_error(isl_ctx *ctx); |
255 | | void isl_ctx_set_error(isl_ctx *ctx, enum isl_error error); |
256 | | |
257 | | #if defined(__cplusplus) |
258 | | } |
259 | | #endif |
260 | | |
261 | | #endif |