1#ifndef LLVM_OpenMP_INC
2#define LLVM_OpenMP_INC
3
4#include "llvm/ADT/ArrayRef.h"
5#include "llvm/ADT/BitmaskEnum.h"
6#include "llvm/ADT/Sequence.h"
7#include "llvm/ADT/StringRef.h"
8#include "llvm/Frontend/Directive/Spelling.h"
9#include "llvm/Support/Compiler.h"
10#include <cstddef>
11#include <utility>
12
13namespace llvm {
14
15namespace omp {
16
17LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
18
19enum class Association {
20 Block,
21 First_ = Block,
22 Declaration,
23 Delimited,
24 LoopNest,
25 LoopSeq,
26 None,
27 Separating,
28 Last_ = Separating,
29};
30
31static constexpr std::size_t Association_enumSize = 7;
32
33enum class Category {
34 Declarative,
35 First_ = Declarative,
36 Executable,
37 Informational,
38 Meta,
39 Subsidiary,
40 Utility,
41 Last_ = Utility,
42};
43
44static constexpr std::size_t Category_enumSize = 6;
45
46enum class SourceLanguage : uint32_t {
47 C = 1U,
48 Fortran = 2U,
49 LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/Fortran)
50};
51
52static constexpr std::size_t SourceLanguage_enumSize = 2;
53
54enum class Directive {
55 OMPD_allocate,
56 First_ = OMPD_allocate,
57 OMPD_allocators,
58 OMPD_assume,
59 OMPD_assumes,
60 OMPD_atomic,
61 OMPD_barrier,
62 OMPD_begin_assumes,
63 OMPD_begin_declare_target,
64 OMPD_begin_declare_variant,
65 OMPD_cancel,
66 OMPD_cancellation_point,
67 OMPD_critical,
68 OMPD_declare_induction,
69 OMPD_declare_mapper,
70 OMPD_declare_reduction,
71 OMPD_declare_simd,
72 OMPD_declare_target,
73 OMPD_declare_variant,
74 OMPD_depobj,
75 OMPD_distribute,
76 OMPD_distribute_parallel_do,
77 OMPD_distribute_parallel_do_simd,
78 OMPD_distribute_parallel_for,
79 OMPD_distribute_parallel_for_simd,
80 OMPD_distribute_simd,
81 OMPD_do,
82 OMPD_do_simd,
83 OMPD_end_assumes,
84 OMPD_end_declare_target,
85 OMPD_end_declare_variant,
86 OMPD_end_do,
87 OMPD_end_do_simd,
88 OMPD_end_scope,
89 OMPD_end_sections,
90 OMPD_end_single,
91 OMPD_end_workdistribute,
92 OMPD_end_workshare,
93 OMPD_error,
94 OMPD_flatten,
95 OMPD_flush,
96 OMPD_for,
97 OMPD_for_simd,
98 OMPD_fuse,
99 OMPD_groupprivate,
100 OMPD_interchange,
101 OMPD_masked_taskloop,
102 OMPD_masked_taskloop_simd,
103 OMPD_master,
104 OMPD_master_taskloop,
105 OMPD_master_taskloop_simd,
106 OMPD_metadirective,
107 OMPD_nothing,
108 OMPD_ordered,
109 OMPD_parallel,
110 OMPD_parallel_do,
111 OMPD_parallel_do_simd,
112 OMPD_parallel_for,
113 OMPD_parallel_for_simd,
114 OMPD_parallel_masked,
115 OMPD_parallel_masked_taskloop,
116 OMPD_parallel_masked_taskloop_simd,
117 OMPD_parallel_master,
118 OMPD_parallel_master_taskloop,
119 OMPD_parallel_master_taskloop_simd,
120 OMPD_parallel_sections,
121 OMPD_parallel_workshare,
122 OMPD_requires,
123 OMPD_reverse,
124 OMPD_scan,
125 OMPD_scope,
126 OMPD_section,
127 OMPD_sections,
128 OMPD_simd,
129 OMPD_single,
130 OMPD_split,
131 OMPD_stripe,
132 OMPD_target,
133 OMPD_target_data,
134 OMPD_target_enter_data,
135 OMPD_target_exit_data,
136 OMPD_target_parallel,
137 OMPD_target_parallel_do,
138 OMPD_target_parallel_do_simd,
139 OMPD_target_parallel_for,
140 OMPD_target_parallel_for_simd,
141 OMPD_target_simd,
142 OMPD_target_teams,
143 OMPD_target_teams_distribute,
144 OMPD_target_teams_distribute_parallel_do,
145 OMPD_target_teams_distribute_parallel_do_simd,
146 OMPD_target_teams_distribute_parallel_for,
147 OMPD_target_teams_distribute_parallel_for_simd,
148 OMPD_target_teams_distribute_simd,
149 OMPD_target_teams_workdistribute,
150 OMPD_target_update,
151 OMPD_task,
152 OMPD_taskgroup,
153 OMPD_taskloop,
154 OMPD_taskloop_simd,
155 OMPD_taskwait,
156 OMPD_taskyield,
157 OMPD_taskgraph,
158 OMPD_teams,
159 OMPD_teams_distribute,
160 OMPD_teams_distribute_parallel_do,
161 OMPD_teams_distribute_parallel_do_simd,
162 OMPD_teams_distribute_parallel_for,
163 OMPD_teams_distribute_parallel_for_simd,
164 OMPD_teams_distribute_simd,
165 OMPD_teams_workdistribute,
166 OMPD_threadprivate,
167 OMPD_tile,
168 OMPD_unknown,
169 OMPD_unroll,
170 OMPD_workdistribute,
171 OMPD_workshare,
172 OMPD_dispatch,
173 OMPD_interop,
174 OMPD_loop,
175 OMPD_masked,
176 OMPD_parallel_loop,
177 OMPD_target_loop,
178 OMPD_target_parallel_loop,
179 OMPD_target_teams_loop,
180 OMPD_teams_loop,
181 Last_ = OMPD_teams_loop,
182};
183
184static constexpr std::size_t Directive_enumSize = 125;
185
186constexpr auto OMPD_allocate = Directive::OMPD_allocate;
187constexpr auto OMPD_allocators = Directive::OMPD_allocators;
188constexpr auto OMPD_assume = Directive::OMPD_assume;
189constexpr auto OMPD_assumes = Directive::OMPD_assumes;
190constexpr auto OMPD_atomic = Directive::OMPD_atomic;
191constexpr auto OMPD_barrier = Directive::OMPD_barrier;
192constexpr auto OMPD_begin_assumes = Directive::OMPD_begin_assumes;
193constexpr auto OMPD_begin_declare_target = Directive::OMPD_begin_declare_target;
194constexpr auto OMPD_begin_declare_variant = Directive::OMPD_begin_declare_variant;
195constexpr auto OMPD_cancel = Directive::OMPD_cancel;
196constexpr auto OMPD_cancellation_point = Directive::OMPD_cancellation_point;
197constexpr auto OMPD_critical = Directive::OMPD_critical;
198constexpr auto OMPD_declare_induction = Directive::OMPD_declare_induction;
199constexpr auto OMPD_declare_mapper = Directive::OMPD_declare_mapper;
200constexpr auto OMPD_declare_reduction = Directive::OMPD_declare_reduction;
201constexpr auto OMPD_declare_simd = Directive::OMPD_declare_simd;
202constexpr auto OMPD_declare_target = Directive::OMPD_declare_target;
203constexpr auto OMPD_declare_variant = Directive::OMPD_declare_variant;
204constexpr auto OMPD_depobj = Directive::OMPD_depobj;
205constexpr auto OMPD_distribute = Directive::OMPD_distribute;
206constexpr auto OMPD_distribute_parallel_do = Directive::OMPD_distribute_parallel_do;
207constexpr auto OMPD_distribute_parallel_do_simd = Directive::OMPD_distribute_parallel_do_simd;
208constexpr auto OMPD_distribute_parallel_for = Directive::OMPD_distribute_parallel_for;
209constexpr auto OMPD_distribute_parallel_for_simd = Directive::OMPD_distribute_parallel_for_simd;
210constexpr auto OMPD_distribute_simd = Directive::OMPD_distribute_simd;
211constexpr auto OMPD_do = Directive::OMPD_do;
212constexpr auto OMPD_do_simd = Directive::OMPD_do_simd;
213constexpr auto OMPD_end_assumes = Directive::OMPD_end_assumes;
214constexpr auto OMPD_end_declare_target = Directive::OMPD_end_declare_target;
215constexpr auto OMPD_end_declare_variant = Directive::OMPD_end_declare_variant;
216constexpr auto OMPD_end_do = Directive::OMPD_end_do;
217constexpr auto OMPD_end_do_simd = Directive::OMPD_end_do_simd;
218constexpr auto OMPD_end_scope = Directive::OMPD_end_scope;
219constexpr auto OMPD_end_sections = Directive::OMPD_end_sections;
220constexpr auto OMPD_end_single = Directive::OMPD_end_single;
221constexpr auto OMPD_end_workdistribute = Directive::OMPD_end_workdistribute;
222constexpr auto OMPD_end_workshare = Directive::OMPD_end_workshare;
223constexpr auto OMPD_error = Directive::OMPD_error;
224constexpr auto OMPD_flatten = Directive::OMPD_flatten;
225constexpr auto OMPD_flush = Directive::OMPD_flush;
226constexpr auto OMPD_for = Directive::OMPD_for;
227constexpr auto OMPD_for_simd = Directive::OMPD_for_simd;
228constexpr auto OMPD_fuse = Directive::OMPD_fuse;
229constexpr auto OMPD_groupprivate = Directive::OMPD_groupprivate;
230constexpr auto OMPD_interchange = Directive::OMPD_interchange;
231constexpr auto OMPD_masked_taskloop = Directive::OMPD_masked_taskloop;
232constexpr auto OMPD_masked_taskloop_simd = Directive::OMPD_masked_taskloop_simd;
233constexpr auto OMPD_master = Directive::OMPD_master;
234constexpr auto OMPD_master_taskloop = Directive::OMPD_master_taskloop;
235constexpr auto OMPD_master_taskloop_simd = Directive::OMPD_master_taskloop_simd;
236constexpr auto OMPD_metadirective = Directive::OMPD_metadirective;
237constexpr auto OMPD_nothing = Directive::OMPD_nothing;
238constexpr auto OMPD_ordered = Directive::OMPD_ordered;
239constexpr auto OMPD_parallel = Directive::OMPD_parallel;
240constexpr auto OMPD_parallel_do = Directive::OMPD_parallel_do;
241constexpr auto OMPD_parallel_do_simd = Directive::OMPD_parallel_do_simd;
242constexpr auto OMPD_parallel_for = Directive::OMPD_parallel_for;
243constexpr auto OMPD_parallel_for_simd = Directive::OMPD_parallel_for_simd;
244constexpr auto OMPD_parallel_masked = Directive::OMPD_parallel_masked;
245constexpr auto OMPD_parallel_masked_taskloop = Directive::OMPD_parallel_masked_taskloop;
246constexpr auto OMPD_parallel_masked_taskloop_simd = Directive::OMPD_parallel_masked_taskloop_simd;
247constexpr auto OMPD_parallel_master = Directive::OMPD_parallel_master;
248constexpr auto OMPD_parallel_master_taskloop = Directive::OMPD_parallel_master_taskloop;
249constexpr auto OMPD_parallel_master_taskloop_simd = Directive::OMPD_parallel_master_taskloop_simd;
250constexpr auto OMPD_parallel_sections = Directive::OMPD_parallel_sections;
251constexpr auto OMPD_parallel_workshare = Directive::OMPD_parallel_workshare;
252constexpr auto OMPD_requires = Directive::OMPD_requires;
253constexpr auto OMPD_reverse = Directive::OMPD_reverse;
254constexpr auto OMPD_scan = Directive::OMPD_scan;
255constexpr auto OMPD_scope = Directive::OMPD_scope;
256constexpr auto OMPD_section = Directive::OMPD_section;
257constexpr auto OMPD_sections = Directive::OMPD_sections;
258constexpr auto OMPD_simd = Directive::OMPD_simd;
259constexpr auto OMPD_single = Directive::OMPD_single;
260constexpr auto OMPD_split = Directive::OMPD_split;
261constexpr auto OMPD_stripe = Directive::OMPD_stripe;
262constexpr auto OMPD_target = Directive::OMPD_target;
263constexpr auto OMPD_target_data = Directive::OMPD_target_data;
264constexpr auto OMPD_target_enter_data = Directive::OMPD_target_enter_data;
265constexpr auto OMPD_target_exit_data = Directive::OMPD_target_exit_data;
266constexpr auto OMPD_target_parallel = Directive::OMPD_target_parallel;
267constexpr auto OMPD_target_parallel_do = Directive::OMPD_target_parallel_do;
268constexpr auto OMPD_target_parallel_do_simd = Directive::OMPD_target_parallel_do_simd;
269constexpr auto OMPD_target_parallel_for = Directive::OMPD_target_parallel_for;
270constexpr auto OMPD_target_parallel_for_simd = Directive::OMPD_target_parallel_for_simd;
271constexpr auto OMPD_target_simd = Directive::OMPD_target_simd;
272constexpr auto OMPD_target_teams = Directive::OMPD_target_teams;
273constexpr auto OMPD_target_teams_distribute = Directive::OMPD_target_teams_distribute;
274constexpr auto OMPD_target_teams_distribute_parallel_do = Directive::OMPD_target_teams_distribute_parallel_do;
275constexpr auto OMPD_target_teams_distribute_parallel_do_simd = Directive::OMPD_target_teams_distribute_parallel_do_simd;
276constexpr auto OMPD_target_teams_distribute_parallel_for = Directive::OMPD_target_teams_distribute_parallel_for;
277constexpr auto OMPD_target_teams_distribute_parallel_for_simd = Directive::OMPD_target_teams_distribute_parallel_for_simd;
278constexpr auto OMPD_target_teams_distribute_simd = Directive::OMPD_target_teams_distribute_simd;
279constexpr auto OMPD_target_teams_workdistribute = Directive::OMPD_target_teams_workdistribute;
280constexpr auto OMPD_target_update = Directive::OMPD_target_update;
281constexpr auto OMPD_task = Directive::OMPD_task;
282constexpr auto OMPD_taskgroup = Directive::OMPD_taskgroup;
283constexpr auto OMPD_taskloop = Directive::OMPD_taskloop;
284constexpr auto OMPD_taskloop_simd = Directive::OMPD_taskloop_simd;
285constexpr auto OMPD_taskwait = Directive::OMPD_taskwait;
286constexpr auto OMPD_taskyield = Directive::OMPD_taskyield;
287constexpr auto OMPD_taskgraph = Directive::OMPD_taskgraph;
288constexpr auto OMPD_teams = Directive::OMPD_teams;
289constexpr auto OMPD_teams_distribute = Directive::OMPD_teams_distribute;
290constexpr auto OMPD_teams_distribute_parallel_do = Directive::OMPD_teams_distribute_parallel_do;
291constexpr auto OMPD_teams_distribute_parallel_do_simd = Directive::OMPD_teams_distribute_parallel_do_simd;
292constexpr auto OMPD_teams_distribute_parallel_for = Directive::OMPD_teams_distribute_parallel_for;
293constexpr auto OMPD_teams_distribute_parallel_for_simd = Directive::OMPD_teams_distribute_parallel_for_simd;
294constexpr auto OMPD_teams_distribute_simd = Directive::OMPD_teams_distribute_simd;
295constexpr auto OMPD_teams_workdistribute = Directive::OMPD_teams_workdistribute;
296constexpr auto OMPD_threadprivate = Directive::OMPD_threadprivate;
297constexpr auto OMPD_tile = Directive::OMPD_tile;
298constexpr auto OMPD_unknown = Directive::OMPD_unknown;
299constexpr auto OMPD_unroll = Directive::OMPD_unroll;
300constexpr auto OMPD_workdistribute = Directive::OMPD_workdistribute;
301constexpr auto OMPD_workshare = Directive::OMPD_workshare;
302constexpr auto OMPD_dispatch = Directive::OMPD_dispatch;
303constexpr auto OMPD_interop = Directive::OMPD_interop;
304constexpr auto OMPD_loop = Directive::OMPD_loop;
305constexpr auto OMPD_masked = Directive::OMPD_masked;
306constexpr auto OMPD_parallel_loop = Directive::OMPD_parallel_loop;
307constexpr auto OMPD_target_loop = Directive::OMPD_target_loop;
308constexpr auto OMPD_target_parallel_loop = Directive::OMPD_target_parallel_loop;
309constexpr auto OMPD_target_teams_loop = Directive::OMPD_target_teams_loop;
310constexpr auto OMPD_teams_loop = Directive::OMPD_teams_loop;
311
312enum class Clause {
313 OMPC_absent,
314 First_ = OMPC_absent,
315 OMPC_acq_rel,
316 OMPC_acquire,
317 OMPC_adjust_args,
318 OMPC_affinity,
319 OMPC_align,
320 OMPC_aligned,
321 OMPC_allocate,
322 OMPC_allocator,
323 OMPC_append_args,
324 OMPC_apply,
325 OMPC_at,
326 OMPC_atomic_default_mem_order,
327 OMPC_bind,
328 OMPC_cancellation_construct_type,
329 OMPC_capture,
330 OMPC_collapse,
331 OMPC_collector,
332 OMPC_combiner,
333 OMPC_compare,
334 OMPC_contains,
335 OMPC_copyprivate,
336 OMPC_copyin,
337 OMPC_counts,
338 OMPC_default,
339 OMPC_defaultmap,
340 OMPC_depend,
341 OMPC_depobj,
342 OMPC_depth,
343 OMPC_destroy,
344 OMPC_detach,
345 OMPC_device,
346 OMPC_device_safesync,
347 OMPC_device_type,
348 OMPC_dist_schedule,
349 OMPC_doacross,
350 OMPC_dyn_groupprivate,
351 OMPC_dynamic_allocators,
352 OMPC_enter,
353 OMPC_exclusive,
354 OMPC_fail,
355 OMPC_filter,
356 OMPC_final,
357 OMPC_firstprivate,
358 OMPC_flush,
359 OMPC_from,
360 OMPC_full,
361 OMPC_grainsize,
362 OMPC_graph_id,
363 OMPC_graph_reset,
364 OMPC_groupprivate,
365 OMPC_has_device_addr,
366 OMPC_hint,
367 OMPC_holds,
368 OMPC_if,
369 OMPC_in_reduction,
370 OMPC_inbranch,
371 OMPC_inclusive,
372 OMPC_indirect,
373 OMPC_induction,
374 OMPC_inductor,
375 OMPC_init,
376 OMPC_init_complete,
377 OMPC_initializer,
378 OMPC_interop,
379 OMPC_is_device_ptr,
380 OMPC_lastprivate,
381 OMPC_linear,
382 OMPC_link,
383 OMPC_local,
384 OMPC_looprange,
385 OMPC_map,
386 OMPC_match,
387 OMPC_memory_order,
388 OMPC_memscope,
389 OMPC_mergeable,
390 OMPC_message,
391 OMPC_nogroup,
392 OMPC_no_openmp,
393 OMPC_no_openmp_constructs,
394 OMPC_no_openmp_routines,
395 OMPC_no_parallelism,
396 OMPC_nowait,
397 OMPC_nocontext,
398 OMPC_nontemporal,
399 OMPC_notinbranch,
400 OMPC_novariants,
401 OMPC_num_tasks,
402 OMPC_num_teams,
403 OMPC_num_threads,
404 OMPC_ompx_attribute,
405 OMPC_ompx_bare,
406 OMPC_ompx_dyn_cgroup_mem,
407 OMPC_order,
408 OMPC_ordered,
409 OMPC_otherwise,
410 OMPC_partial,
411 OMPC_permutation,
412 OMPC_priority,
413 OMPC_private,
414 OMPC_proc_bind,
415 OMPC_read,
416 OMPC_reduction,
417 OMPC_relaxed,
418 OMPC_release,
419 OMPC_replayable,
420 OMPC_reverse_offload,
421 OMPC_safelen,
422 OMPC_safesync,
423 OMPC_schedule,
424 OMPC_self_maps,
425 OMPC_seq_cst,
426 OMPC_severity,
427 OMPC_shared,
428 OMPC_simd,
429 OMPC_simdlen,
430 OMPC_sizes,
431 OMPC_task_reduction,
432 OMPC_thread_limit,
433 OMPC_threadprivate,
434 OMPC_threads,
435 OMPC_threadset,
436 OMPC_to,
437 OMPC_transparent,
438 OMPC_unified_address,
439 OMPC_unified_shared_memory,
440 OMPC_uniform,
441 OMPC_unknown,
442 OMPC_untied,
443 OMPC_update,
444 OMPC_use,
445 OMPC_use_device_addr,
446 OMPC_use_device_ptr,
447 OMPC_uses_allocators,
448 OMPC_weak,
449 OMPC_when,
450 OMPC_write,
451 Last_ = OMPC_write,
452};
453
454static constexpr std::size_t Clause_enumSize = 137;
455
456constexpr auto OMPC_absent = Clause::OMPC_absent;
457constexpr auto OMPC_acq_rel = Clause::OMPC_acq_rel;
458constexpr auto OMPC_acquire = Clause::OMPC_acquire;
459constexpr auto OMPC_adjust_args = Clause::OMPC_adjust_args;
460constexpr auto OMPC_affinity = Clause::OMPC_affinity;
461constexpr auto OMPC_align = Clause::OMPC_align;
462constexpr auto OMPC_aligned = Clause::OMPC_aligned;
463constexpr auto OMPC_allocate = Clause::OMPC_allocate;
464constexpr auto OMPC_allocator = Clause::OMPC_allocator;
465constexpr auto OMPC_append_args = Clause::OMPC_append_args;
466constexpr auto OMPC_apply = Clause::OMPC_apply;
467constexpr auto OMPC_at = Clause::OMPC_at;
468constexpr auto OMPC_atomic_default_mem_order = Clause::OMPC_atomic_default_mem_order;
469constexpr auto OMPC_bind = Clause::OMPC_bind;
470constexpr auto OMPC_cancellation_construct_type = Clause::OMPC_cancellation_construct_type;
471constexpr auto OMPC_capture = Clause::OMPC_capture;
472constexpr auto OMPC_collapse = Clause::OMPC_collapse;
473constexpr auto OMPC_collector = Clause::OMPC_collector;
474constexpr auto OMPC_combiner = Clause::OMPC_combiner;
475constexpr auto OMPC_compare = Clause::OMPC_compare;
476constexpr auto OMPC_contains = Clause::OMPC_contains;
477constexpr auto OMPC_copyprivate = Clause::OMPC_copyprivate;
478constexpr auto OMPC_copyin = Clause::OMPC_copyin;
479constexpr auto OMPC_counts = Clause::OMPC_counts;
480constexpr auto OMPC_default = Clause::OMPC_default;
481constexpr auto OMPC_defaultmap = Clause::OMPC_defaultmap;
482constexpr auto OMPC_depend = Clause::OMPC_depend;
483constexpr auto OMPC_depobj = Clause::OMPC_depobj;
484constexpr auto OMPC_depth = Clause::OMPC_depth;
485constexpr auto OMPC_destroy = Clause::OMPC_destroy;
486constexpr auto OMPC_detach = Clause::OMPC_detach;
487constexpr auto OMPC_device = Clause::OMPC_device;
488constexpr auto OMPC_device_safesync = Clause::OMPC_device_safesync;
489constexpr auto OMPC_device_type = Clause::OMPC_device_type;
490constexpr auto OMPC_dist_schedule = Clause::OMPC_dist_schedule;
491constexpr auto OMPC_doacross = Clause::OMPC_doacross;
492constexpr auto OMPC_dyn_groupprivate = Clause::OMPC_dyn_groupprivate;
493constexpr auto OMPC_dynamic_allocators = Clause::OMPC_dynamic_allocators;
494constexpr auto OMPC_enter = Clause::OMPC_enter;
495constexpr auto OMPC_exclusive = Clause::OMPC_exclusive;
496constexpr auto OMPC_fail = Clause::OMPC_fail;
497constexpr auto OMPC_filter = Clause::OMPC_filter;
498constexpr auto OMPC_final = Clause::OMPC_final;
499constexpr auto OMPC_firstprivate = Clause::OMPC_firstprivate;
500constexpr auto OMPC_flush = Clause::OMPC_flush;
501constexpr auto OMPC_from = Clause::OMPC_from;
502constexpr auto OMPC_full = Clause::OMPC_full;
503constexpr auto OMPC_grainsize = Clause::OMPC_grainsize;
504constexpr auto OMPC_graph_id = Clause::OMPC_graph_id;
505constexpr auto OMPC_graph_reset = Clause::OMPC_graph_reset;
506constexpr auto OMPC_groupprivate = Clause::OMPC_groupprivate;
507constexpr auto OMPC_has_device_addr = Clause::OMPC_has_device_addr;
508constexpr auto OMPC_hint = Clause::OMPC_hint;
509constexpr auto OMPC_holds = Clause::OMPC_holds;
510constexpr auto OMPC_if = Clause::OMPC_if;
511constexpr auto OMPC_in_reduction = Clause::OMPC_in_reduction;
512constexpr auto OMPC_inbranch = Clause::OMPC_inbranch;
513constexpr auto OMPC_inclusive = Clause::OMPC_inclusive;
514constexpr auto OMPC_indirect = Clause::OMPC_indirect;
515constexpr auto OMPC_induction = Clause::OMPC_induction;
516constexpr auto OMPC_inductor = Clause::OMPC_inductor;
517constexpr auto OMPC_init = Clause::OMPC_init;
518constexpr auto OMPC_init_complete = Clause::OMPC_init_complete;
519constexpr auto OMPC_initializer = Clause::OMPC_initializer;
520constexpr auto OMPC_interop = Clause::OMPC_interop;
521constexpr auto OMPC_is_device_ptr = Clause::OMPC_is_device_ptr;
522constexpr auto OMPC_lastprivate = Clause::OMPC_lastprivate;
523constexpr auto OMPC_linear = Clause::OMPC_linear;
524constexpr auto OMPC_link = Clause::OMPC_link;
525constexpr auto OMPC_local = Clause::OMPC_local;
526constexpr auto OMPC_looprange = Clause::OMPC_looprange;
527constexpr auto OMPC_map = Clause::OMPC_map;
528constexpr auto OMPC_match = Clause::OMPC_match;
529constexpr auto OMPC_memory_order = Clause::OMPC_memory_order;
530constexpr auto OMPC_memscope = Clause::OMPC_memscope;
531constexpr auto OMPC_mergeable = Clause::OMPC_mergeable;
532constexpr auto OMPC_message = Clause::OMPC_message;
533constexpr auto OMPC_nogroup = Clause::OMPC_nogroup;
534constexpr auto OMPC_no_openmp = Clause::OMPC_no_openmp;
535constexpr auto OMPC_no_openmp_constructs = Clause::OMPC_no_openmp_constructs;
536constexpr auto OMPC_no_openmp_routines = Clause::OMPC_no_openmp_routines;
537constexpr auto OMPC_no_parallelism = Clause::OMPC_no_parallelism;
538constexpr auto OMPC_nowait = Clause::OMPC_nowait;
539constexpr auto OMPC_nocontext = Clause::OMPC_nocontext;
540constexpr auto OMPC_nontemporal = Clause::OMPC_nontemporal;
541constexpr auto OMPC_notinbranch = Clause::OMPC_notinbranch;
542constexpr auto OMPC_novariants = Clause::OMPC_novariants;
543constexpr auto OMPC_num_tasks = Clause::OMPC_num_tasks;
544constexpr auto OMPC_num_teams = Clause::OMPC_num_teams;
545constexpr auto OMPC_num_threads = Clause::OMPC_num_threads;
546constexpr auto OMPC_ompx_attribute = Clause::OMPC_ompx_attribute;
547constexpr auto OMPC_ompx_bare = Clause::OMPC_ompx_bare;
548constexpr auto OMPC_ompx_dyn_cgroup_mem = Clause::OMPC_ompx_dyn_cgroup_mem;
549constexpr auto OMPC_order = Clause::OMPC_order;
550constexpr auto OMPC_ordered = Clause::OMPC_ordered;
551constexpr auto OMPC_otherwise = Clause::OMPC_otherwise;
552constexpr auto OMPC_partial = Clause::OMPC_partial;
553constexpr auto OMPC_permutation = Clause::OMPC_permutation;
554constexpr auto OMPC_priority = Clause::OMPC_priority;
555constexpr auto OMPC_private = Clause::OMPC_private;
556constexpr auto OMPC_proc_bind = Clause::OMPC_proc_bind;
557constexpr auto OMPC_read = Clause::OMPC_read;
558constexpr auto OMPC_reduction = Clause::OMPC_reduction;
559constexpr auto OMPC_relaxed = Clause::OMPC_relaxed;
560constexpr auto OMPC_release = Clause::OMPC_release;
561constexpr auto OMPC_replayable = Clause::OMPC_replayable;
562constexpr auto OMPC_reverse_offload = Clause::OMPC_reverse_offload;
563constexpr auto OMPC_safelen = Clause::OMPC_safelen;
564constexpr auto OMPC_safesync = Clause::OMPC_safesync;
565constexpr auto OMPC_schedule = Clause::OMPC_schedule;
566constexpr auto OMPC_self_maps = Clause::OMPC_self_maps;
567constexpr auto OMPC_seq_cst = Clause::OMPC_seq_cst;
568constexpr auto OMPC_severity = Clause::OMPC_severity;
569constexpr auto OMPC_shared = Clause::OMPC_shared;
570constexpr auto OMPC_simd = Clause::OMPC_simd;
571constexpr auto OMPC_simdlen = Clause::OMPC_simdlen;
572constexpr auto OMPC_sizes = Clause::OMPC_sizes;
573constexpr auto OMPC_task_reduction = Clause::OMPC_task_reduction;
574constexpr auto OMPC_thread_limit = Clause::OMPC_thread_limit;
575constexpr auto OMPC_threadprivate = Clause::OMPC_threadprivate;
576constexpr auto OMPC_threads = Clause::OMPC_threads;
577constexpr auto OMPC_threadset = Clause::OMPC_threadset;
578constexpr auto OMPC_to = Clause::OMPC_to;
579constexpr auto OMPC_transparent = Clause::OMPC_transparent;
580constexpr auto OMPC_unified_address = Clause::OMPC_unified_address;
581constexpr auto OMPC_unified_shared_memory = Clause::OMPC_unified_shared_memory;
582constexpr auto OMPC_uniform = Clause::OMPC_uniform;
583constexpr auto OMPC_unknown = Clause::OMPC_unknown;
584constexpr auto OMPC_untied = Clause::OMPC_untied;
585constexpr auto OMPC_update = Clause::OMPC_update;
586constexpr auto OMPC_use = Clause::OMPC_use;
587constexpr auto OMPC_use_device_addr = Clause::OMPC_use_device_addr;
588constexpr auto OMPC_use_device_ptr = Clause::OMPC_use_device_ptr;
589constexpr auto OMPC_uses_allocators = Clause::OMPC_uses_allocators;
590constexpr auto OMPC_weak = Clause::OMPC_weak;
591constexpr auto OMPC_when = Clause::OMPC_when;
592constexpr auto OMPC_write = Clause::OMPC_write;
593
594enum class BindKind {
595 OMP_BIND_parallel=1,
596 OMP_BIND_teams=2,
597 OMP_BIND_thread=3,
598};
599
600constexpr auto OMP_BIND_parallel = BindKind::OMP_BIND_parallel;
601constexpr auto OMP_BIND_teams = BindKind::OMP_BIND_teams;
602constexpr auto OMP_BIND_thread = BindKind::OMP_BIND_thread;
603
604enum class CancellationConstructType {
605 OMP_CANCELLATION_CONSTRUCT_Parallel=1,
606 OMP_CANCELLATION_CONSTRUCT_Loop=2,
607 OMP_CANCELLATION_CONSTRUCT_Sections=3,
608 OMP_CANCELLATION_CONSTRUCT_Taskgroup=4,
609 OMP_CANCELLATION_CONSTRUCT_None=5,
610};
611
612constexpr auto OMP_CANCELLATION_CONSTRUCT_Parallel = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Parallel;
613constexpr auto OMP_CANCELLATION_CONSTRUCT_Loop = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Loop;
614constexpr auto OMP_CANCELLATION_CONSTRUCT_Sections = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Sections;
615constexpr auto OMP_CANCELLATION_CONSTRUCT_Taskgroup = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Taskgroup;
616constexpr auto OMP_CANCELLATION_CONSTRUCT_None = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_None;
617
618enum class GrainsizeType {
619 OMP_GRAINSIZE_Strict=1,
620 OMP_GRAINSIZE_Unknown=2,
621};
622
623constexpr auto OMP_GRAINSIZE_Strict = GrainsizeType::OMP_GRAINSIZE_Strict;
624constexpr auto OMP_GRAINSIZE_Unknown = GrainsizeType::OMP_GRAINSIZE_Unknown;
625
626enum class MemoryOrderKind {
627 OMP_MEMORY_ORDER_SeqCst=1,
628 OMP_MEMORY_ORDER_AcqRel=2,
629 OMP_MEMORY_ORDER_Acquire=3,
630 OMP_MEMORY_ORDER_Release=4,
631 OMP_MEMORY_ORDER_Relaxed=5,
632 OMP_MEMORY_ORDER_Default=6,
633};
634
635constexpr auto OMP_MEMORY_ORDER_SeqCst = MemoryOrderKind::OMP_MEMORY_ORDER_SeqCst;
636constexpr auto OMP_MEMORY_ORDER_AcqRel = MemoryOrderKind::OMP_MEMORY_ORDER_AcqRel;
637constexpr auto OMP_MEMORY_ORDER_Acquire = MemoryOrderKind::OMP_MEMORY_ORDER_Acquire;
638constexpr auto OMP_MEMORY_ORDER_Release = MemoryOrderKind::OMP_MEMORY_ORDER_Release;
639constexpr auto OMP_MEMORY_ORDER_Relaxed = MemoryOrderKind::OMP_MEMORY_ORDER_Relaxed;
640constexpr auto OMP_MEMORY_ORDER_Default = MemoryOrderKind::OMP_MEMORY_ORDER_Default;
641
642enum class NumTasksType {
643 OMP_NUMTASKS_Strict=1,
644 OMP_NUMTASKS_Unknown=2,
645};
646
647constexpr auto OMP_NUMTASKS_Strict = NumTasksType::OMP_NUMTASKS_Strict;
648constexpr auto OMP_NUMTASKS_Unknown = NumTasksType::OMP_NUMTASKS_Unknown;
649
650enum class NumThreadsType {
651 OMP_NUMTHREADS_Strict=1,
652 OMP_NUMTHREADS_Unknown=2,
653};
654
655constexpr auto OMP_NUMTHREADS_Strict = NumThreadsType::OMP_NUMTHREADS_Strict;
656constexpr auto OMP_NUMTHREADS_Unknown = NumThreadsType::OMP_NUMTHREADS_Unknown;
657
658enum class OrderKind {
659 OMP_ORDER_unknown=2,
660 OMP_ORDER_concurrent=1,
661};
662
663constexpr auto OMP_ORDER_unknown = OrderKind::OMP_ORDER_unknown;
664constexpr auto OMP_ORDER_concurrent = OrderKind::OMP_ORDER_concurrent;
665
666enum class ProcBindKind {
667 OMP_PROC_BIND_primary=5,
668 OMP_PROC_BIND_master=2,
669 OMP_PROC_BIND_close=3,
670 OMP_PROC_BIND_spread=4,
671 OMP_PROC_BIND_default=6,
672 OMP_PROC_BIND_unknown=7,
673};
674
675constexpr auto OMP_PROC_BIND_primary = ProcBindKind::OMP_PROC_BIND_primary;
676constexpr auto OMP_PROC_BIND_master = ProcBindKind::OMP_PROC_BIND_master;
677constexpr auto OMP_PROC_BIND_close = ProcBindKind::OMP_PROC_BIND_close;
678constexpr auto OMP_PROC_BIND_spread = ProcBindKind::OMP_PROC_BIND_spread;
679constexpr auto OMP_PROC_BIND_default = ProcBindKind::OMP_PROC_BIND_default;
680constexpr auto OMP_PROC_BIND_unknown = ProcBindKind::OMP_PROC_BIND_unknown;
681
682enum class ScheduleKind {
683 OMP_SCHEDULE_Static=2,
684 OMP_SCHEDULE_Dynamic=3,
685 OMP_SCHEDULE_Guided=4,
686 OMP_SCHEDULE_Auto=5,
687 OMP_SCHEDULE_Runtime=6,
688 OMP_SCHEDULE_Distribute=7,
689 OMP_SCHEDULE_Default=8,
690};
691
692constexpr auto OMP_SCHEDULE_Static = ScheduleKind::OMP_SCHEDULE_Static;
693constexpr auto OMP_SCHEDULE_Dynamic = ScheduleKind::OMP_SCHEDULE_Dynamic;
694constexpr auto OMP_SCHEDULE_Guided = ScheduleKind::OMP_SCHEDULE_Guided;
695constexpr auto OMP_SCHEDULE_Auto = ScheduleKind::OMP_SCHEDULE_Auto;
696constexpr auto OMP_SCHEDULE_Runtime = ScheduleKind::OMP_SCHEDULE_Runtime;
697constexpr auto OMP_SCHEDULE_Distribute = ScheduleKind::OMP_SCHEDULE_Distribute;
698constexpr auto OMP_SCHEDULE_Default = ScheduleKind::OMP_SCHEDULE_Default;
699
700// Enumeration helper functions
701LLVM_ABI std::pair<Directive, directive::VersionRange> getOpenMPDirectiveKindAndVersions(StringRef Str);
702inline Directive getOpenMPDirectiveKind(StringRef Str) {
703 return getOpenMPDirectiveKindAndVersions(Str).first;
704}
705
706LLVM_ABI StringRef getOpenMPDirectiveName(Directive D, unsigned Ver = 0);
707
708LLVM_ABI std::pair<Clause, directive::VersionRange> getOpenMPClauseKindAndVersions(StringRef Str);
709
710inline Clause getOpenMPClauseKind(StringRef Str) {
711 return getOpenMPClauseKindAndVersions(Str).first;
712}
713
714LLVM_ABI StringRef getOpenMPClauseName(Clause C, unsigned Ver = 0);
715
716/// Return true if \p C is a valid clause for \p D in version \p Version.
717LLVM_ABI bool isAllowedClauseForDirective(Directive D, Clause C, unsigned Version);
718
719constexpr std::size_t getMaxLeafCount() { return 6; }
720LLVM_ABI Association getDirectiveAssociation(Directive D);
721LLVM_ABI Category getDirectiveCategory(Directive D);
722LLVM_ABI SourceLanguage getDirectiveLanguages(Directive D);
723LLVM_ABI BindKind getBindKind(StringRef Str);
724LLVM_ABI StringRef getOpenMPBindKindName(BindKind x);
725LLVM_ABI CancellationConstructType getCancellationConstructType(StringRef Str);
726LLVM_ABI StringRef getOpenMPCancellationConstructTypeName(CancellationConstructType x);
727LLVM_ABI GrainsizeType getGrainsizeType(StringRef Str);
728LLVM_ABI StringRef getOpenMPGrainsizeTypeName(GrainsizeType x);
729LLVM_ABI MemoryOrderKind getMemoryOrderKind(StringRef Str);
730LLVM_ABI StringRef getOpenMPMemoryOrderKindName(MemoryOrderKind x);
731LLVM_ABI NumTasksType getNumTasksType(StringRef Str);
732LLVM_ABI StringRef getOpenMPNumTasksTypeName(NumTasksType x);
733LLVM_ABI NumThreadsType getNumThreadsType(StringRef Str);
734LLVM_ABI StringRef getOpenMPNumThreadsTypeName(NumThreadsType x);
735LLVM_ABI OrderKind getOrderKind(StringRef Str);
736LLVM_ABI StringRef getOpenMPOrderKindName(OrderKind x);
737LLVM_ABI ProcBindKind getProcBindKind(StringRef Str);
738LLVM_ABI StringRef getOpenMPProcBindKindName(ProcBindKind x);
739LLVM_ABI ScheduleKind getScheduleKind(StringRef Str);
740LLVM_ABI StringRef getOpenMPScheduleKindName(ScheduleKind x);
741
742} // namespace omp
743
744template <> struct enum_iteration_traits<omp::Association> {
745 static constexpr bool is_iterable = true;
746};
747
748template <> struct enum_iteration_traits<omp::Category> {
749 static constexpr bool is_iterable = true;
750};
751
752template <> struct enum_iteration_traits<omp::Directive> {
753 static constexpr bool is_iterable = true;
754};
755
756template <> struct enum_iteration_traits<omp::Clause> {
757 static constexpr bool is_iterable = true;
758};
759
760} // namespace llvm
761
762#endif // LLVM_OpenMP_INC
763
764