15#include "llvm/ADT/StringRef.h"
16#include "llvm/ADT/StringSwitch.h"
17#include "llvm/Support/ErrorHandling.h"
21using namespace llvm::omp;
27 return llvm::StringSwitch<unsigned>(Str)
28#define OMP_DEFAULT_KIND(Enum, Name) .Case(Name, unsigned(Enum))
29#include "llvm/Frontend/OpenMP/OMPKinds.def"
30 .Default(
unsigned(llvm::omp::OMP_DEFAULT_unknown));
32 return llvm::StringSwitch<unsigned>(Str)
33#define OMP_PROC_BIND_KIND(Enum, Name, Value) .Case(Name, Value)
34#include "llvm/Frontend/OpenMP/OMPKinds.def"
35 .Default(
unsigned(llvm::omp::OMP_PROC_BIND_unknown));
37 return llvm::StringSwitch<unsigned>(Str)
38#define OPENMP_SCHEDULE_KIND(Name) \
39 .Case(#Name, static_cast<unsigned>(OMPC_SCHEDULE_##Name))
40#define OPENMP_SCHEDULE_MODIFIER(Name) \
41 .Case(#Name, static_cast<unsigned>(OMPC_SCHEDULE_MODIFIER_##Name))
42#include "clang/Basic/OpenMPKinds.def"
45 unsigned Type = llvm::StringSwitch<unsigned>(Str)
46#define OPENMP_DEPEND_KIND(Name) .Case(#Name, OMPC_DEPEND_##Name)
47#include "clang/Basic/OpenMPKinds.def"
49 if (LangOpts.OpenMP < 51 &&
Type == OMPC_DEPEND_inoutset)
54 return llvm::StringSwitch<OpenMPDoacrossClauseModifier>(Str)
55#define OPENMP_DOACROSS_MODIFIER(Name) .Case(#Name, OMPC_DOACROSS_##Name)
56#include "clang/Basic/OpenMPKinds.def"
59 return llvm::StringSwitch<OpenMPLinearClauseKind>(Str)
60#define OPENMP_LINEAR_KIND(Name) .Case(#Name, OMPC_LINEAR_##Name)
61#include "clang/Basic/OpenMPKinds.def"
64 unsigned Type = llvm::StringSwitch<unsigned>(Str)
65#define OPENMP_MAP_KIND(Name) \
66 .Case(#Name, static_cast<unsigned>(OMPC_MAP_##Name))
67#define OPENMP_MAP_MODIFIER_KIND(Name) \
68 .Case(#Name, static_cast<unsigned>(OMPC_MAP_MODIFIER_##Name))
69#include "clang/Basic/OpenMPKinds.def"
71 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MAP_MODIFIER_present)
73 if (!LangOpts.OpenMPExtensions &&
Type == OMPC_MAP_MODIFIER_ompx_hold)
79 unsigned Type = llvm::StringSwitch<unsigned>(Str)
80#define OPENMP_MOTION_MODIFIER_KIND(Name) \
81 .Case(#Name, static_cast<unsigned>(OMPC_MOTION_MODIFIER_##Name))
82#include "clang/Basic/OpenMPKinds.def"
84 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MOTION_MODIFIER_present)
88 case OMPC_dist_schedule:
89 return llvm::StringSwitch<OpenMPDistScheduleClauseKind>(Str)
90#define OPENMP_DIST_SCHEDULE_KIND(Name) .Case(#Name, OMPC_DIST_SCHEDULE_##Name)
91#include "clang/Basic/OpenMPKinds.def"
94 return llvm::StringSwitch<unsigned>(Str)
95#define OPENMP_DEFAULTMAP_KIND(Name) \
96 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_##Name))
97#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
98 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_MODIFIER_##Name))
99#include "clang/Basic/OpenMPKinds.def"
101 case OMPC_atomic_default_mem_order:
102 return llvm::StringSwitch<OpenMPAtomicDefaultMemOrderClauseKind>(Str)
103#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
104 .Case(#Name, OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name)
105#include "clang/Basic/OpenMPKinds.def"
107 case OMPC_device_type:
108 return llvm::StringSwitch<OpenMPDeviceType>(Str)
109#define OPENMP_DEVICE_TYPE_KIND(Name) .Case(#Name, OMPC_DEVICE_TYPE_##Name)
110#include "clang/Basic/OpenMPKinds.def"
113 return llvm::StringSwitch<OpenMPAtClauseKind>(Str)
114#define OPENMP_AT_KIND(Name) .Case(#Name, OMPC_AT_##Name)
115#include "clang/Basic/OpenMPKinds.def"
118 return llvm::StringSwitch<OpenMPSeverityClauseKind>(Str)
119#define OPENMP_SEVERITY_KIND(Name) .Case(#Name, OMPC_SEVERITY_##Name)
120#include "clang/Basic/OpenMPKinds.def"
122 case OMPC_lastprivate:
123 return llvm::StringSwitch<OpenMPLastprivateModifier>(Str)
124#define OPENMP_LASTPRIVATE_KIND(Name) .Case(#Name, OMPC_LASTPRIVATE_##Name)
125#include "clang/Basic/OpenMPKinds.def"
128 return llvm::StringSwitch<unsigned>(Str)
129#define OPENMP_ORDER_KIND(Name) \
130 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_##Name))
131#define OPENMP_ORDER_MODIFIER(Name) \
132 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_MODIFIER_##Name))
133#include "clang/Basic/OpenMPKinds.def"
136 return llvm::StringSwitch<OpenMPDependClauseKind>(Str)
137#define OPENMP_DEPEND_KIND(Name) .Case(#Name, OMPC_DEPEND_##Name)
138#include "clang/Basic/OpenMPKinds.def"
141 return llvm::StringSwitch<OpenMPDeviceClauseModifier>(Str)
142#define OPENMP_DEVICE_MODIFIER(Name) .Case(#Name, OMPC_DEVICE_##Name)
143#include "clang/Basic/OpenMPKinds.def"
146 return llvm::StringSwitch<OpenMPReductionClauseModifier>(Str)
147#define OPENMP_REDUCTION_MODIFIER(Name) .Case(#Name, OMPC_REDUCTION_##Name)
148#include "clang/Basic/OpenMPKinds.def"
150 case OMPC_adjust_args:
151 return llvm::StringSwitch<OpenMPAdjustArgsOpKind>(Str)
152#define OPENMP_ADJUST_ARGS_KIND(Name) .Case(#Name, OMPC_ADJUST_ARGS_##Name)
153#include "clang/Basic/OpenMPKinds.def"
156 return llvm::StringSwitch<unsigned>(Str)
157#define OPENMP_BIND_KIND(Name) .Case(#Name, OMPC_BIND_##Name)
158#include "clang/Basic/OpenMPKinds.def"
160 case OMPC_grainsize: {
161 unsigned Type = llvm::StringSwitch<unsigned>(Str)
162#define OPENMP_GRAINSIZE_MODIFIER(Name) .Case(#Name, OMPC_GRAINSIZE_##Name)
163#include "clang/Basic/OpenMPKinds.def"
165 if (LangOpts.OpenMP < 51)
169 case OMPC_num_tasks: {
170 unsigned Type = llvm::StringSwitch<unsigned>(Str)
171#define OPENMP_NUMTASKS_MODIFIER(Name) .Case(#Name, OMPC_NUMTASKS_##Name)
172#include "clang/Basic/OpenMPKinds.def"
174 if (LangOpts.OpenMP < 51)
179 case OMPC_threadprivate:
182 case OMPC_num_threads:
190 case OMPC_firstprivate:
192 case OMPC_task_reduction:
193 case OMPC_in_reduction:
196 case OMPC_copyprivate:
215 case OMPC_thread_limit:
220 case OMPC_use_device_ptr:
221 case OMPC_use_device_addr:
222 case OMPC_is_device_ptr:
223 case OMPC_has_device_addr:
224 case OMPC_unified_address:
225 case OMPC_unified_shared_memory:
226 case OMPC_reverse_offload:
227 case OMPC_dynamic_allocators:
229 case OMPC_nontemporal:
231 case OMPC_novariants:
236 case OMPC_uses_allocators:
239 case OMPC_append_args:
244 llvm_unreachable(
"Invalid OpenMP simple clause kind");
251 switch (llvm::omp::DefaultKind(
Type)) {
252#define OMP_DEFAULT_KIND(Enum, Name) \
255#include "llvm/Frontend/OpenMP/OMPKinds.def"
257 llvm_unreachable(
"Invalid OpenMP 'default' clause type");
260#define OMP_PROC_BIND_KIND(Enum, Name, Value) \
263#include "llvm/Frontend/OpenMP/OMPKinds.def"
265 llvm_unreachable(
"Invalid OpenMP 'proc_bind' clause type");
271#define OPENMP_SCHEDULE_KIND(Name) \
272 case OMPC_SCHEDULE_##Name: \
274#define OPENMP_SCHEDULE_MODIFIER(Name) \
275 case OMPC_SCHEDULE_MODIFIER_##Name: \
277#include "clang/Basic/OpenMPKinds.def"
279 llvm_unreachable(
"Invalid OpenMP 'schedule' clause type");
284#define OPENMP_DEPEND_KIND(Name) \
285 case OMPC_DEPEND_##Name: \
287#include "clang/Basic/OpenMPKinds.def"
289 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
294#define OPENMP_DOACROSS_MODIFIER(Name) \
295 case OMPC_DOACROSS_##Name: \
297#include "clang/Basic/OpenMPKinds.def"
299 llvm_unreachable(
"Invalid OpenMP 'doacross' clause type");
304#define OPENMP_LINEAR_KIND(Name) \
305 case OMPC_LINEAR_##Name: \
307#include "clang/Basic/OpenMPKinds.def"
309 llvm_unreachable(
"Invalid OpenMP 'linear' clause type");
315#define OPENMP_MAP_KIND(Name) \
316 case OMPC_MAP_##Name: \
318#define OPENMP_MAP_MODIFIER_KIND(Name) \
319 case OMPC_MAP_MODIFIER_##Name: \
321#include "clang/Basic/OpenMPKinds.def"
325 llvm_unreachable(
"Invalid OpenMP 'map' clause type");
331#define OPENMP_MOTION_MODIFIER_KIND(Name) \
332 case OMPC_MOTION_MODIFIER_##Name: \
334#include "clang/Basic/OpenMPKinds.def"
338 llvm_unreachable(
"Invalid OpenMP 'to' or 'from' clause type");
339 case OMPC_dist_schedule:
343#define OPENMP_DIST_SCHEDULE_KIND(Name) \
344 case OMPC_DIST_SCHEDULE_##Name: \
346#include "clang/Basic/OpenMPKinds.def"
348 llvm_unreachable(
"Invalid OpenMP 'dist_schedule' clause type");
349 case OMPC_defaultmap:
354#define OPENMP_DEFAULTMAP_KIND(Name) \
355 case OMPC_DEFAULTMAP_##Name: \
357#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
358 case OMPC_DEFAULTMAP_MODIFIER_##Name: \
360#include "clang/Basic/OpenMPKinds.def"
362 llvm_unreachable(
"Invalid OpenMP 'schedule' clause type");
363 case OMPC_atomic_default_mem_order:
367#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
368 case OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name: \
370#include "clang/Basic/OpenMPKinds.def"
372 llvm_unreachable(
"Invalid OpenMP 'atomic_default_mem_order' clause type");
373 case OMPC_device_type:
377#define OPENMP_DEVICE_TYPE_KIND(Name) \
378 case OMPC_DEVICE_TYPE_##Name: \
380#include "clang/Basic/OpenMPKinds.def"
382 llvm_unreachable(
"Invalid OpenMP 'device_type' clause type");
387#define OPENMP_AT_KIND(Name) \
388 case OMPC_AT_##Name: \
390#include "clang/Basic/OpenMPKinds.def"
392 llvm_unreachable(
"Invalid OpenMP 'at' clause type");
397#define OPENMP_SEVERITY_KIND(Name) \
398 case OMPC_SEVERITY_##Name: \
400#include "clang/Basic/OpenMPKinds.def"
402 llvm_unreachable(
"Invalid OpenMP 'severity' clause type");
403 case OMPC_lastprivate:
407#define OPENMP_LASTPRIVATE_KIND(Name) \
408 case OMPC_LASTPRIVATE_##Name: \
410#include "clang/Basic/OpenMPKinds.def"
412 llvm_unreachable(
"Invalid OpenMP 'lastprivate' clause type");
418#define OPENMP_ORDER_KIND(Name) \
419 case OMPC_ORDER_##Name: \
421#define OPENMP_ORDER_MODIFIER(Name) \
422 case OMPC_ORDER_MODIFIER_##Name: \
424#include "clang/Basic/OpenMPKinds.def"
426 llvm_unreachable(
"Invalid OpenMP 'order' clause type");
431#define OPENMP_DEPEND_KIND(Name) \
432 case OMPC_DEPEND_##Name: \
434#include "clang/Basic/OpenMPKinds.def"
436 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
441#define OPENMP_DEVICE_MODIFIER(Name) \
442 case OMPC_DEVICE_##Name: \
444#include "clang/Basic/OpenMPKinds.def"
446 llvm_unreachable(
"Invalid OpenMP 'device' clause modifier");
451#define OPENMP_REDUCTION_MODIFIER(Name) \
452 case OMPC_REDUCTION_##Name: \
454#include "clang/Basic/OpenMPKinds.def"
456 llvm_unreachable(
"Invalid OpenMP 'reduction' clause modifier");
457 case OMPC_adjust_args:
461#define OPENMP_ADJUST_ARGS_KIND(Name) \
462 case OMPC_ADJUST_ARGS_##Name: \
464#include "clang/Basic/OpenMPKinds.def"
466 llvm_unreachable(
"Invalid OpenMP 'adjust_args' clause kind");
471#define OPENMP_BIND_KIND(Name) \
472 case OMPC_BIND_##Name: \
474#include "clang/Basic/OpenMPKinds.def"
476 llvm_unreachable(
"Invalid OpenMP 'bind' clause type");
481#define OPENMP_GRAINSIZE_MODIFIER(Name) \
482 case OMPC_GRAINSIZE_##Name: \
484#include "clang/Basic/OpenMPKinds.def"
486 llvm_unreachable(
"Invalid OpenMP 'grainsize' clause modifier");
491#define OPENMP_NUMTASKS_MODIFIER(Name) \
492 case OMPC_NUMTASKS_##Name: \
494#include "clang/Basic/OpenMPKinds.def"
496 llvm_unreachable(
"Invalid OpenMP 'num_tasks' clause modifier");
498 case OMPC_threadprivate:
501 case OMPC_num_threads:
509 case OMPC_firstprivate:
511 case OMPC_task_reduction:
512 case OMPC_in_reduction:
515 case OMPC_copyprivate:
534 case OMPC_thread_limit:
539 case OMPC_use_device_ptr:
540 case OMPC_use_device_addr:
541 case OMPC_is_device_ptr:
542 case OMPC_has_device_addr:
543 case OMPC_unified_address:
544 case OMPC_unified_shared_memory:
545 case OMPC_reverse_offload:
546 case OMPC_dynamic_allocators:
548 case OMPC_nontemporal:
551 case OMPC_novariants:
555 case OMPC_uses_allocators:
558 case OMPC_append_args:
563 llvm_unreachable(
"Invalid OpenMP simple clause kind");
567 return DKind == OMPD_simd || DKind == OMPD_for || DKind == OMPD_for_simd ||
568 DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
569 DKind == OMPD_taskloop || DKind == OMPD_taskloop_simd ||
570 DKind == OMPD_master_taskloop || DKind == OMPD_master_taskloop_simd ||
571 DKind == OMPD_parallel_master_taskloop ||
572 DKind == OMPD_parallel_master_taskloop_simd ||
573 DKind == OMPD_masked_taskloop || DKind == OMPD_masked_taskloop_simd ||
574 DKind == OMPD_parallel_masked_taskloop || DKind == OMPD_distribute ||
575 DKind == OMPD_parallel_masked_taskloop_simd ||
576 DKind == OMPD_target_parallel_for ||
577 DKind == OMPD_distribute_parallel_for ||
578 DKind == OMPD_distribute_parallel_for_simd ||
579 DKind == OMPD_distribute_simd ||
580 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
581 DKind == OMPD_teams_distribute ||
582 DKind == OMPD_teams_distribute_simd ||
583 DKind == OMPD_teams_distribute_parallel_for_simd ||
584 DKind == OMPD_teams_distribute_parallel_for ||
585 DKind == OMPD_target_teams_distribute ||
586 DKind == OMPD_target_teams_distribute_parallel_for ||
587 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
588 DKind == OMPD_target_teams_distribute_simd || DKind == OMPD_tile ||
589 DKind == OMPD_unroll || DKind == OMPD_loop ||
590 DKind == OMPD_teams_loop || DKind == OMPD_target_teams_loop ||
591 DKind == OMPD_parallel_loop || DKind == OMPD_target_parallel_loop;
595 return DKind == OMPD_for || DKind == OMPD_for_simd ||
596 DKind == OMPD_sections || DKind == OMPD_section ||
597 DKind == OMPD_single || DKind == OMPD_parallel_for ||
598 DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections ||
599 DKind == OMPD_target_parallel_for ||
600 DKind == OMPD_distribute_parallel_for ||
601 DKind == OMPD_distribute_parallel_for_simd ||
602 DKind == OMPD_target_parallel_for_simd ||
603 DKind == OMPD_teams_distribute_parallel_for_simd ||
604 DKind == OMPD_teams_distribute_parallel_for ||
605 DKind == OMPD_target_teams_distribute_parallel_for ||
606 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
607 DKind == OMPD_parallel_loop || DKind == OMPD_teams_loop ||
608 DKind == OMPD_target_parallel_loop || DKind == OMPD_target_teams_loop;
612 return DKind == OMPD_taskloop || DKind == OMPD_taskloop_simd ||
613 DKind == OMPD_master_taskloop || DKind == OMPD_master_taskloop_simd ||
614 DKind == OMPD_parallel_master_taskloop ||
615 DKind == OMPD_masked_taskloop || DKind == OMPD_masked_taskloop_simd ||
616 DKind == OMPD_parallel_masked_taskloop ||
617 DKind == OMPD_parallel_masked_taskloop_simd ||
618 DKind == OMPD_parallel_master_taskloop_simd;
622 return DKind == OMPD_parallel || DKind == OMPD_parallel_for ||
623 DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections ||
624 DKind == OMPD_target_parallel || DKind == OMPD_target_parallel_for ||
625 DKind == OMPD_distribute_parallel_for ||
626 DKind == OMPD_distribute_parallel_for_simd ||
627 DKind == OMPD_target_parallel_for_simd ||
628 DKind == OMPD_teams_distribute_parallel_for ||
629 DKind == OMPD_teams_distribute_parallel_for_simd ||
630 DKind == OMPD_target_teams_distribute_parallel_for ||
631 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
632 DKind == OMPD_parallel_master || DKind == OMPD_parallel_masked ||
633 DKind == OMPD_parallel_master_taskloop ||
634 DKind == OMPD_parallel_master_taskloop_simd ||
635 DKind == OMPD_parallel_masked_taskloop ||
636 DKind == OMPD_parallel_masked_taskloop_simd ||
637 DKind == OMPD_parallel_loop || DKind == OMPD_target_parallel_loop ||
638 DKind == OMPD_teams_loop;
642 return DKind == OMPD_target || DKind == OMPD_target_parallel ||
643 DKind == OMPD_target_parallel_for ||
644 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
645 DKind == OMPD_target_teams || DKind == OMPD_target_teams_distribute ||
646 DKind == OMPD_target_teams_distribute_parallel_for ||
647 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
648 DKind == OMPD_target_teams_distribute_simd ||
649 DKind == OMPD_target_teams_loop || DKind == OMPD_target_parallel_loop;
653 return DKind == OMPD_target_data || DKind == OMPD_target_enter_data ||
654 DKind == OMPD_target_exit_data || DKind == OMPD_target_update;
658 return DKind == OMPD_teams || DKind == OMPD_teams_distribute ||
659 DKind == OMPD_teams_distribute_simd ||
660 DKind == OMPD_teams_distribute_parallel_for_simd ||
661 DKind == OMPD_teams_distribute_parallel_for ||
662 DKind == OMPD_teams_loop;
667 DKind == OMPD_target_teams_distribute ||
668 DKind == OMPD_target_teams_distribute_parallel_for ||
669 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
670 DKind == OMPD_target_teams_distribute_simd ||
671 DKind == OMPD_target_teams_loop;
675 return DKind == OMPD_simd || DKind == OMPD_for_simd ||
676 DKind == OMPD_parallel_for_simd || DKind == OMPD_taskloop_simd ||
677 DKind == OMPD_master_taskloop_simd ||
678 DKind == OMPD_masked_taskloop_simd ||
679 DKind == OMPD_parallel_master_taskloop_simd ||
680 DKind == OMPD_parallel_masked_taskloop_simd ||
681 DKind == OMPD_distribute_parallel_for_simd ||
682 DKind == OMPD_distribute_simd || DKind == OMPD_target_simd ||
683 DKind == OMPD_teams_distribute_simd ||
684 DKind == OMPD_teams_distribute_parallel_for_simd ||
685 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
686 DKind == OMPD_target_teams_distribute_simd ||
687 DKind == OMPD_target_parallel_for_simd;
691 return Kind == OMPD_distribute || Kind == OMPD_distribute_parallel_for ||
692 Kind == OMPD_distribute_parallel_for_simd ||
693 Kind == OMPD_distribute_simd;
699 Kind == OMPD_teams_distribute || Kind == OMPD_teams_distribute_simd ||
700 Kind == OMPD_teams_distribute_parallel_for_simd ||
701 Kind == OMPD_teams_distribute_parallel_for ||
702 Kind == OMPD_target_teams_distribute ||
703 Kind == OMPD_target_teams_distribute_parallel_for ||
704 Kind == OMPD_target_teams_distribute_parallel_for_simd ||
705 Kind == OMPD_target_teams_distribute_simd;
709 return Kind == OMPD_loop || Kind == OMPD_teams_loop ||
710 Kind == OMPD_target_teams_loop || Kind == OMPD_parallel_loop ||
711 Kind == OMPD_target_parallel_loop;
715 return Kind == OMPC_private || Kind == OMPC_firstprivate ||
716 Kind == OMPC_lastprivate || Kind == OMPC_linear ||
717 Kind == OMPC_reduction || Kind == OMPC_task_reduction ||
718 Kind == OMPC_in_reduction;
722 return Kind == OMPC_threadprivate || Kind == OMPC_copyin;
730 return Kind == OMPD_distribute_parallel_for ||
731 Kind == OMPD_distribute_parallel_for_simd ||
732 Kind == OMPD_teams_distribute_parallel_for_simd ||
733 Kind == OMPD_teams_distribute_parallel_for ||
734 Kind == OMPD_target_teams_distribute_parallel_for ||
735 Kind == OMPD_target_teams_distribute_parallel_for_simd ||
736 Kind == OMPD_teams_loop || Kind == OMPD_target_teams_loop;
740 return DKind == OMPD_tile || DKind == OMPD_unroll;
744 return DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
745 DKind == OMPD_parallel_master ||
746 DKind == OMPD_parallel_master_taskloop ||
747 DKind == OMPD_parallel_master_taskloop_simd ||
748 DKind == OMPD_parallel_sections;
752 return DKind == OMPD_target || DKind == OMPD_target_parallel ||
753 DKind == OMPD_target_parallel_for ||
754 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
755 DKind == OMPD_target_parallel_loop;
761 assert(
unsigned(DKind) < llvm::omp::Directive_enumSize);
763 case OMPD_metadirective:
764 CaptureRegions.push_back(OMPD_metadirective);
767 case OMPD_parallel_for:
768 case OMPD_parallel_for_simd:
769 case OMPD_parallel_master:
770 case OMPD_parallel_masked:
771 case OMPD_parallel_sections:
772 case OMPD_distribute_parallel_for:
773 case OMPD_distribute_parallel_for_simd:
774 case OMPD_parallel_loop:
775 CaptureRegions.push_back(OMPD_parallel);
777 case OMPD_target_teams:
778 case OMPD_target_teams_distribute:
779 case OMPD_target_teams_distribute_simd:
780 CaptureRegions.push_back(OMPD_task);
781 CaptureRegions.push_back(OMPD_target);
782 CaptureRegions.push_back(OMPD_teams);
785 case OMPD_teams_distribute:
786 case OMPD_teams_distribute_simd:
787 CaptureRegions.push_back(OMPD_teams);
790 case OMPD_target_simd:
791 CaptureRegions.push_back(OMPD_task);
792 CaptureRegions.push_back(OMPD_target);
794 case OMPD_teams_loop:
795 case OMPD_teams_distribute_parallel_for:
796 case OMPD_teams_distribute_parallel_for_simd:
797 CaptureRegions.push_back(OMPD_teams);
798 CaptureRegions.push_back(OMPD_parallel);
800 case OMPD_target_parallel:
801 case OMPD_target_parallel_for:
802 case OMPD_target_parallel_for_simd:
803 case OMPD_target_parallel_loop:
804 CaptureRegions.push_back(OMPD_task);
805 CaptureRegions.push_back(OMPD_target);
806 CaptureRegions.push_back(OMPD_parallel);
809 case OMPD_target_enter_data:
810 case OMPD_target_exit_data:
811 case OMPD_target_update:
812 CaptureRegions.push_back(OMPD_task);
815 case OMPD_taskloop_simd:
816 case OMPD_master_taskloop:
817 case OMPD_master_taskloop_simd:
818 case OMPD_masked_taskloop:
819 case OMPD_masked_taskloop_simd:
820 CaptureRegions.push_back(OMPD_taskloop);
822 case OMPD_parallel_masked_taskloop:
823 case OMPD_parallel_masked_taskloop_simd:
824 case OMPD_parallel_master_taskloop:
825 case OMPD_parallel_master_taskloop_simd:
826 CaptureRegions.push_back(OMPD_parallel);
827 CaptureRegions.push_back(OMPD_taskloop);
829 case OMPD_target_teams_loop:
830 case OMPD_target_teams_distribute_parallel_for:
831 case OMPD_target_teams_distribute_parallel_for_simd:
832 CaptureRegions.push_back(OMPD_task);
833 CaptureRegions.push_back(OMPD_target);
834 CaptureRegions.push_back(OMPD_teams);
835 CaptureRegions.push_back(OMPD_parallel);
838 CaptureRegions.push_back(OMPD_nothing);
853 case OMPD_distribute:
856 case OMPD_target_data:
857 case OMPD_distribute_simd:
860 CaptureRegions.push_back(OMPD_unknown);
866 case OMPD_threadprivate:
872 case OMPD_cancellation_point:
877 case OMPD_declare_reduction:
878 case OMPD_declare_mapper:
879 case OMPD_declare_simd:
880 case OMPD_declare_target:
881 case OMPD_end_declare_target:
883 case OMPD_declare_variant:
884 case OMPD_begin_declare_variant:
885 case OMPD_end_declare_variant:
886 llvm_unreachable(
"OpenMP Directive is not allowed");
889 llvm_unreachable(
"Unknown OpenMP directive");
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Defines some OpenMP-specific enums and functions.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
The base class of the type hierarchy.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
bool needsTaskBasedThreadLimit(OpenMPDirectiveKind DKind)
Checks if the specified target directive, combined or not, needs task based thread_limit.
bool isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a teams directive in the outermost n...
bool isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target data offload directive.
bool isOpenMPLoopTransformationDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a loop transformation directive.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
@ OMPC_DEFAULTMAP_MODIFIER_last
@ OMPC_ORDER_MODIFIER_last
@ OMPC_ADJUST_ARGS_unknown
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
@ OMPC_DEVICE_TYPE_unknown
@ OMPC_SCHEDULE_MODIFIER_last
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a parallel-kind directive.
bool isOpenMPPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of private clauses like 'private', 'firstprivate',...
@ OMPC_DIST_SCHEDULE_unknown
bool isOpenMPTaskingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of tasking directives - task, taskloop,...
bool isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target code offload directive.
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
bool isOpenMPGenericLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive constitutes a 'loop' directive in the outermost nest.
@ OMPC_LASTPRIVATE_unknown
unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str, const LangOptions &LangOpts)
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
@ OMPC_MOTION_MODIFIER_unknown
@ OMPC_DEFAULTMAP_unknown
bool isOpenMPThreadPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of threadprivate clauses like 'threadprivate',...
bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a simd directive.
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
@ OMPC_MAP_MODIFIER_unknown
bool isOpenMPCombinedParallelADirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a combined construct for which the first construct is a parallel...
bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a distribute directive in the outerm...
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.