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<OpenMPLinearClauseKind>(Str)
55#define OPENMP_LINEAR_KIND(Name) .Case(#Name, OMPC_LINEAR_##Name)
56#include "clang/Basic/OpenMPKinds.def"
59 unsigned Type = llvm::StringSwitch<unsigned>(Str)
60#define OPENMP_MAP_KIND(Name) \
61 .Case(#Name, static_cast<unsigned>(OMPC_MAP_##Name))
62#define OPENMP_MAP_MODIFIER_KIND(Name) \
63 .Case(#Name, static_cast<unsigned>(OMPC_MAP_MODIFIER_##Name))
64#include "clang/Basic/OpenMPKinds.def"
66 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MAP_MODIFIER_present)
68 if (!LangOpts.OpenMPExtensions &&
Type == OMPC_MAP_MODIFIER_ompx_hold)
74 unsigned Type = llvm::StringSwitch<unsigned>(Str)
75#define OPENMP_MOTION_MODIFIER_KIND(Name) \
76 .Case(#Name, static_cast<unsigned>(OMPC_MOTION_MODIFIER_##Name))
77#include "clang/Basic/OpenMPKinds.def"
79 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MOTION_MODIFIER_present)
83 case OMPC_dist_schedule:
84 return llvm::StringSwitch<OpenMPDistScheduleClauseKind>(Str)
85#define OPENMP_DIST_SCHEDULE_KIND(Name) .Case(#Name, OMPC_DIST_SCHEDULE_##Name)
86#include "clang/Basic/OpenMPKinds.def"
89 return llvm::StringSwitch<unsigned>(Str)
90#define OPENMP_DEFAULTMAP_KIND(Name) \
91 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_##Name))
92#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
93 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_MODIFIER_##Name))
94#include "clang/Basic/OpenMPKinds.def"
96 case OMPC_atomic_default_mem_order:
97 return llvm::StringSwitch<OpenMPAtomicDefaultMemOrderClauseKind>(Str)
98#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
99 .Case(#Name, OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name)
100#include "clang/Basic/OpenMPKinds.def"
102 case OMPC_device_type:
103 return llvm::StringSwitch<OpenMPDeviceType>(Str)
104#define OPENMP_DEVICE_TYPE_KIND(Name) .Case(#Name, OMPC_DEVICE_TYPE_##Name)
105#include "clang/Basic/OpenMPKinds.def"
108 return llvm::StringSwitch<OpenMPAtClauseKind>(Str)
109#define OPENMP_AT_KIND(Name) .Case(#Name, OMPC_AT_##Name)
110#include "clang/Basic/OpenMPKinds.def"
113 return llvm::StringSwitch<OpenMPSeverityClauseKind>(Str)
114#define OPENMP_SEVERITY_KIND(Name) .Case(#Name, OMPC_SEVERITY_##Name)
115#include "clang/Basic/OpenMPKinds.def"
117 case OMPC_lastprivate:
118 return llvm::StringSwitch<OpenMPLastprivateModifier>(Str)
119#define OPENMP_LASTPRIVATE_KIND(Name) .Case(#Name, OMPC_LASTPRIVATE_##Name)
120#include "clang/Basic/OpenMPKinds.def"
123 return llvm::StringSwitch<unsigned>(Str)
124#define OPENMP_ORDER_KIND(Name) \
125 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_##Name))
126#define OPENMP_ORDER_MODIFIER(Name) \
127 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_MODIFIER_##Name))
128#include "clang/Basic/OpenMPKinds.def"
131 return llvm::StringSwitch<OpenMPDependClauseKind>(Str)
132#define OPENMP_DEPEND_KIND(Name) .Case(#Name, OMPC_DEPEND_##Name)
133#include "clang/Basic/OpenMPKinds.def"
136 return llvm::StringSwitch<OpenMPDeviceClauseModifier>(Str)
137#define OPENMP_DEVICE_MODIFIER(Name) .Case(#Name, OMPC_DEVICE_##Name)
138#include "clang/Basic/OpenMPKinds.def"
141 return llvm::StringSwitch<OpenMPReductionClauseModifier>(Str)
142#define OPENMP_REDUCTION_MODIFIER(Name) .Case(#Name, OMPC_REDUCTION_##Name)
143#include "clang/Basic/OpenMPKinds.def"
145 case OMPC_adjust_args:
146 return llvm::StringSwitch<OpenMPAdjustArgsOpKind>(Str)
147#define OPENMP_ADJUST_ARGS_KIND(Name) .Case(#Name, OMPC_ADJUST_ARGS_##Name)
148#include "clang/Basic/OpenMPKinds.def"
151 return llvm::StringSwitch<unsigned>(Str)
152#define OPENMP_BIND_KIND(Name) .Case(#Name, OMPC_BIND_##Name)
153#include "clang/Basic/OpenMPKinds.def"
155 case OMPC_grainsize: {
156 unsigned Type = llvm::StringSwitch<unsigned>(Str)
157#define OPENMP_GRAINSIZE_MODIFIER(Name) .Case(#Name, OMPC_GRAINSIZE_##Name)
158#include "clang/Basic/OpenMPKinds.def"
160 if (LangOpts.OpenMP < 51)
164 case OMPC_num_tasks: {
165 unsigned Type = llvm::StringSwitch<unsigned>(Str)
166#define OPENMP_NUMTASKS_MODIFIER(Name) .Case(#Name, OMPC_NUMTASKS_##Name)
167#include "clang/Basic/OpenMPKinds.def"
169 if (LangOpts.OpenMP < 51)
174 case OMPC_threadprivate:
177 case OMPC_num_threads:
185 case OMPC_firstprivate:
187 case OMPC_task_reduction:
188 case OMPC_in_reduction:
191 case OMPC_copyprivate:
210 case OMPC_thread_limit:
215 case OMPC_use_device_ptr:
216 case OMPC_use_device_addr:
217 case OMPC_is_device_ptr:
218 case OMPC_has_device_addr:
219 case OMPC_unified_address:
220 case OMPC_unified_shared_memory:
221 case OMPC_reverse_offload:
222 case OMPC_dynamic_allocators:
224 case OMPC_nontemporal:
226 case OMPC_novariants:
231 case OMPC_uses_allocators:
234 case OMPC_append_args:
239 llvm_unreachable(
"Invalid OpenMP simple clause kind");
246 switch (llvm::omp::DefaultKind(
Type)) {
247#define OMP_DEFAULT_KIND(Enum, Name) \
250#include "llvm/Frontend/OpenMP/OMPKinds.def"
252 llvm_unreachable(
"Invalid OpenMP 'default' clause type");
255#define OMP_PROC_BIND_KIND(Enum, Name, Value) \
258#include "llvm/Frontend/OpenMP/OMPKinds.def"
260 llvm_unreachable(
"Invalid OpenMP 'proc_bind' clause type");
266#define OPENMP_SCHEDULE_KIND(Name) \
267 case OMPC_SCHEDULE_##Name: \
269#define OPENMP_SCHEDULE_MODIFIER(Name) \
270 case OMPC_SCHEDULE_MODIFIER_##Name: \
272#include "clang/Basic/OpenMPKinds.def"
274 llvm_unreachable(
"Invalid OpenMP 'schedule' clause type");
279#define OPENMP_DEPEND_KIND(Name) \
280 case OMPC_DEPEND_##Name: \
282#include "clang/Basic/OpenMPKinds.def"
284 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
289#define OPENMP_LINEAR_KIND(Name) \
290 case OMPC_LINEAR_##Name: \
292#include "clang/Basic/OpenMPKinds.def"
294 llvm_unreachable(
"Invalid OpenMP 'linear' clause type");
300#define OPENMP_MAP_KIND(Name) \
301 case OMPC_MAP_##Name: \
303#define OPENMP_MAP_MODIFIER_KIND(Name) \
304 case OMPC_MAP_MODIFIER_##Name: \
306#include "clang/Basic/OpenMPKinds.def"
310 llvm_unreachable(
"Invalid OpenMP 'map' clause type");
316#define OPENMP_MOTION_MODIFIER_KIND(Name) \
317 case OMPC_MOTION_MODIFIER_##Name: \
319#include "clang/Basic/OpenMPKinds.def"
323 llvm_unreachable(
"Invalid OpenMP 'to' or 'from' clause type");
324 case OMPC_dist_schedule:
328#define OPENMP_DIST_SCHEDULE_KIND(Name) \
329 case OMPC_DIST_SCHEDULE_##Name: \
331#include "clang/Basic/OpenMPKinds.def"
333 llvm_unreachable(
"Invalid OpenMP 'dist_schedule' clause type");
334 case OMPC_defaultmap:
339#define OPENMP_DEFAULTMAP_KIND(Name) \
340 case OMPC_DEFAULTMAP_##Name: \
342#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
343 case OMPC_DEFAULTMAP_MODIFIER_##Name: \
345#include "clang/Basic/OpenMPKinds.def"
347 llvm_unreachable(
"Invalid OpenMP 'schedule' clause type");
348 case OMPC_atomic_default_mem_order:
352#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
353 case OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name: \
355#include "clang/Basic/OpenMPKinds.def"
357 llvm_unreachable(
"Invalid OpenMP 'atomic_default_mem_order' clause type");
358 case OMPC_device_type:
362#define OPENMP_DEVICE_TYPE_KIND(Name) \
363 case OMPC_DEVICE_TYPE_##Name: \
365#include "clang/Basic/OpenMPKinds.def"
367 llvm_unreachable(
"Invalid OpenMP 'device_type' clause type");
372#define OPENMP_AT_KIND(Name) \
373 case OMPC_AT_##Name: \
375#include "clang/Basic/OpenMPKinds.def"
377 llvm_unreachable(
"Invalid OpenMP 'at' clause type");
382#define OPENMP_SEVERITY_KIND(Name) \
383 case OMPC_SEVERITY_##Name: \
385#include "clang/Basic/OpenMPKinds.def"
387 llvm_unreachable(
"Invalid OpenMP 'severity' clause type");
388 case OMPC_lastprivate:
392#define OPENMP_LASTPRIVATE_KIND(Name) \
393 case OMPC_LASTPRIVATE_##Name: \
395#include "clang/Basic/OpenMPKinds.def"
397 llvm_unreachable(
"Invalid OpenMP 'lastprivate' clause type");
403#define OPENMP_ORDER_KIND(Name) \
404 case OMPC_ORDER_##Name: \
406#define OPENMP_ORDER_MODIFIER(Name) \
407 case OMPC_ORDER_MODIFIER_##Name: \
409#include "clang/Basic/OpenMPKinds.def"
411 llvm_unreachable(
"Invalid OpenMP 'order' clause type");
416#define OPENMP_DEPEND_KIND(Name) \
417 case OMPC_DEPEND_##Name: \
419#include "clang/Basic/OpenMPKinds.def"
421 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
426#define OPENMP_DEVICE_MODIFIER(Name) \
427 case OMPC_DEVICE_##Name: \
429#include "clang/Basic/OpenMPKinds.def"
431 llvm_unreachable(
"Invalid OpenMP 'device' clause modifier");
436#define OPENMP_REDUCTION_MODIFIER(Name) \
437 case OMPC_REDUCTION_##Name: \
439#include "clang/Basic/OpenMPKinds.def"
441 llvm_unreachable(
"Invalid OpenMP 'reduction' clause modifier");
442 case OMPC_adjust_args:
446#define OPENMP_ADJUST_ARGS_KIND(Name) \
447 case OMPC_ADJUST_ARGS_##Name: \
449#include "clang/Basic/OpenMPKinds.def"
451 llvm_unreachable(
"Invalid OpenMP 'adjust_args' clause kind");
456#define OPENMP_BIND_KIND(Name) \
457 case OMPC_BIND_##Name: \
459#include "clang/Basic/OpenMPKinds.def"
461 llvm_unreachable(
"Invalid OpenMP 'bind' clause type");
466#define OPENMP_GRAINSIZE_MODIFIER(Name) \
467 case OMPC_GRAINSIZE_##Name: \
469#include "clang/Basic/OpenMPKinds.def"
471 llvm_unreachable(
"Invalid OpenMP 'grainsize' clause modifier");
476#define OPENMP_NUMTASKS_MODIFIER(Name) \
477 case OMPC_NUMTASKS_##Name: \
479#include "clang/Basic/OpenMPKinds.def"
481 llvm_unreachable(
"Invalid OpenMP 'num_tasks' clause modifier");
483 case OMPC_threadprivate:
486 case OMPC_num_threads:
494 case OMPC_firstprivate:
496 case OMPC_task_reduction:
497 case OMPC_in_reduction:
500 case OMPC_copyprivate:
519 case OMPC_thread_limit:
524 case OMPC_use_device_ptr:
525 case OMPC_use_device_addr:
526 case OMPC_is_device_ptr:
527 case OMPC_has_device_addr:
528 case OMPC_unified_address:
529 case OMPC_unified_shared_memory:
530 case OMPC_reverse_offload:
531 case OMPC_dynamic_allocators:
533 case OMPC_nontemporal:
536 case OMPC_novariants:
540 case OMPC_uses_allocators:
543 case OMPC_append_args:
548 llvm_unreachable(
"Invalid OpenMP simple clause kind");
552 return DKind == OMPD_simd || DKind == OMPD_for || DKind == OMPD_for_simd ||
553 DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
554 DKind == OMPD_taskloop || DKind == OMPD_taskloop_simd ||
555 DKind == OMPD_master_taskloop || DKind == OMPD_master_taskloop_simd ||
556 DKind == OMPD_parallel_master_taskloop ||
557 DKind == OMPD_parallel_master_taskloop_simd ||
558 DKind == OMPD_masked_taskloop || DKind == OMPD_masked_taskloop_simd ||
559 DKind == OMPD_parallel_masked_taskloop || DKind == OMPD_distribute ||
560 DKind == OMPD_parallel_masked_taskloop_simd ||
561 DKind == OMPD_target_parallel_for ||
562 DKind == OMPD_distribute_parallel_for ||
563 DKind == OMPD_distribute_parallel_for_simd ||
564 DKind == OMPD_distribute_simd ||
565 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
566 DKind == OMPD_teams_distribute ||
567 DKind == OMPD_teams_distribute_simd ||
568 DKind == OMPD_teams_distribute_parallel_for_simd ||
569 DKind == OMPD_teams_distribute_parallel_for ||
570 DKind == OMPD_target_teams_distribute ||
571 DKind == OMPD_target_teams_distribute_parallel_for ||
572 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
573 DKind == OMPD_target_teams_distribute_simd || DKind == OMPD_tile ||
574 DKind == OMPD_unroll || DKind == OMPD_loop ||
575 DKind == OMPD_teams_loop || DKind == OMPD_target_teams_loop ||
576 DKind == OMPD_parallel_loop || DKind == OMPD_target_parallel_loop;
580 return DKind == OMPD_for || DKind == OMPD_for_simd ||
581 DKind == OMPD_sections || DKind == OMPD_section ||
582 DKind == OMPD_single || DKind == OMPD_parallel_for ||
583 DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections ||
584 DKind == OMPD_target_parallel_for ||
585 DKind == OMPD_distribute_parallel_for ||
586 DKind == OMPD_distribute_parallel_for_simd ||
587 DKind == OMPD_target_parallel_for_simd ||
588 DKind == OMPD_teams_distribute_parallel_for_simd ||
589 DKind == OMPD_teams_distribute_parallel_for ||
590 DKind == OMPD_target_teams_distribute_parallel_for ||
591 DKind == OMPD_target_teams_distribute_parallel_for_simd;
595 return DKind == OMPD_taskloop || DKind == OMPD_taskloop_simd ||
596 DKind == OMPD_master_taskloop || DKind == OMPD_master_taskloop_simd ||
597 DKind == OMPD_parallel_master_taskloop ||
598 DKind == OMPD_masked_taskloop || DKind == OMPD_masked_taskloop_simd ||
599 DKind == OMPD_parallel_masked_taskloop ||
600 DKind == OMPD_parallel_masked_taskloop_simd ||
601 DKind == OMPD_parallel_master_taskloop_simd;
605 return DKind == OMPD_parallel || DKind == OMPD_parallel_for ||
606 DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections ||
607 DKind == OMPD_target_parallel || DKind == OMPD_target_parallel_for ||
608 DKind == OMPD_distribute_parallel_for ||
609 DKind == OMPD_distribute_parallel_for_simd ||
610 DKind == OMPD_target_parallel_for_simd ||
611 DKind == OMPD_teams_distribute_parallel_for ||
612 DKind == OMPD_teams_distribute_parallel_for_simd ||
613 DKind == OMPD_target_teams_distribute_parallel_for ||
614 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
615 DKind == OMPD_parallel_master || DKind == OMPD_parallel_masked ||
616 DKind == OMPD_parallel_master_taskloop ||
617 DKind == OMPD_parallel_master_taskloop_simd ||
618 DKind == OMPD_parallel_masked_taskloop ||
619 DKind == OMPD_parallel_masked_taskloop_simd ||
620 DKind == OMPD_parallel_loop || DKind == OMPD_target_parallel_loop;
624 return DKind == OMPD_target || DKind == OMPD_target_parallel ||
625 DKind == OMPD_target_parallel_for ||
626 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
627 DKind == OMPD_target_teams || DKind == OMPD_target_teams_distribute ||
628 DKind == OMPD_target_teams_distribute_parallel_for ||
629 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
630 DKind == OMPD_target_teams_distribute_simd ||
631 DKind == OMPD_target_teams_loop || DKind == OMPD_target_parallel_loop;
635 return DKind == OMPD_target_data || DKind == OMPD_target_enter_data ||
636 DKind == OMPD_target_exit_data || DKind == OMPD_target_update;
640 return DKind == OMPD_teams || DKind == OMPD_teams_distribute ||
641 DKind == OMPD_teams_distribute_simd ||
642 DKind == OMPD_teams_distribute_parallel_for_simd ||
643 DKind == OMPD_teams_distribute_parallel_for ||
644 DKind == OMPD_teams_loop;
649 DKind == OMPD_target_teams_distribute ||
650 DKind == OMPD_target_teams_distribute_parallel_for ||
651 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
652 DKind == OMPD_target_teams_distribute_simd ||
653 DKind == OMPD_target_teams_loop;
657 return DKind == OMPD_simd || DKind == OMPD_for_simd ||
658 DKind == OMPD_parallel_for_simd || DKind == OMPD_taskloop_simd ||
659 DKind == OMPD_master_taskloop_simd ||
660 DKind == OMPD_masked_taskloop_simd ||
661 DKind == OMPD_parallel_master_taskloop_simd ||
662 DKind == OMPD_parallel_masked_taskloop_simd ||
663 DKind == OMPD_distribute_parallel_for_simd ||
664 DKind == OMPD_distribute_simd || DKind == OMPD_target_simd ||
665 DKind == OMPD_teams_distribute_simd ||
666 DKind == OMPD_teams_distribute_parallel_for_simd ||
667 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
668 DKind == OMPD_target_teams_distribute_simd ||
669 DKind == OMPD_target_parallel_for_simd;
673 return Kind == OMPD_distribute || Kind == OMPD_distribute_parallel_for ||
674 Kind == OMPD_distribute_parallel_for_simd ||
675 Kind == OMPD_distribute_simd;
681 Kind == OMPD_teams_distribute || Kind == OMPD_teams_distribute_simd ||
682 Kind == OMPD_teams_distribute_parallel_for_simd ||
683 Kind == OMPD_teams_distribute_parallel_for ||
684 Kind == OMPD_target_teams_distribute ||
685 Kind == OMPD_target_teams_distribute_parallel_for ||
686 Kind == OMPD_target_teams_distribute_parallel_for_simd ||
687 Kind == OMPD_target_teams_distribute_simd;
691 return Kind == OMPD_loop || Kind == OMPD_teams_loop ||
692 Kind == OMPD_target_teams_loop || Kind == OMPD_parallel_loop ||
693 Kind == OMPD_target_parallel_loop;
697 return Kind == OMPC_private || Kind == OMPC_firstprivate ||
698 Kind == OMPC_lastprivate || Kind == OMPC_linear ||
699 Kind == OMPC_reduction || Kind == OMPC_task_reduction ||
700 Kind == OMPC_in_reduction;
704 return Kind == OMPC_threadprivate || Kind == OMPC_copyin;
712 return Kind == OMPD_distribute_parallel_for ||
713 Kind == OMPD_distribute_parallel_for_simd ||
714 Kind == OMPD_teams_distribute_parallel_for_simd ||
715 Kind == OMPD_teams_distribute_parallel_for ||
716 Kind == OMPD_target_teams_distribute_parallel_for ||
717 Kind == OMPD_target_teams_distribute_parallel_for_simd;
721 return DKind == OMPD_tile || DKind == OMPD_unroll;
725 return DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
726 DKind == OMPD_parallel_master ||
727 DKind == OMPD_parallel_master_taskloop ||
728 DKind == OMPD_parallel_master_taskloop_simd ||
729 DKind == OMPD_parallel_sections;
735 assert(
unsigned(DKind) < llvm::omp::Directive_enumSize);
737 case OMPD_metadirective:
738 CaptureRegions.push_back(OMPD_metadirective);
741 case OMPD_parallel_for:
742 case OMPD_parallel_for_simd:
743 case OMPD_parallel_master:
744 case OMPD_parallel_masked:
745 case OMPD_parallel_sections:
746 case OMPD_distribute_parallel_for:
747 case OMPD_distribute_parallel_for_simd:
748 case OMPD_parallel_loop:
749 CaptureRegions.push_back(OMPD_parallel);
751 case OMPD_target_teams:
752 case OMPD_target_teams_distribute:
753 case OMPD_target_teams_distribute_simd:
754 case OMPD_target_teams_loop:
755 CaptureRegions.push_back(OMPD_task);
756 CaptureRegions.push_back(OMPD_target);
757 CaptureRegions.push_back(OMPD_teams);
760 case OMPD_teams_distribute:
761 case OMPD_teams_distribute_simd:
762 CaptureRegions.push_back(OMPD_teams);
765 case OMPD_target_simd:
766 CaptureRegions.push_back(OMPD_task);
767 CaptureRegions.push_back(OMPD_target);
769 case OMPD_teams_distribute_parallel_for:
770 case OMPD_teams_distribute_parallel_for_simd:
771 CaptureRegions.push_back(OMPD_teams);
772 CaptureRegions.push_back(OMPD_parallel);
774 case OMPD_target_parallel:
775 case OMPD_target_parallel_for:
776 case OMPD_target_parallel_for_simd:
777 case OMPD_target_parallel_loop:
778 CaptureRegions.push_back(OMPD_task);
779 CaptureRegions.push_back(OMPD_target);
780 CaptureRegions.push_back(OMPD_parallel);
783 case OMPD_target_enter_data:
784 case OMPD_target_exit_data:
785 case OMPD_target_update:
786 CaptureRegions.push_back(OMPD_task);
789 case OMPD_taskloop_simd:
790 case OMPD_master_taskloop:
791 case OMPD_master_taskloop_simd:
792 case OMPD_masked_taskloop:
793 case OMPD_masked_taskloop_simd:
794 CaptureRegions.push_back(OMPD_taskloop);
796 case OMPD_parallel_masked_taskloop:
797 case OMPD_parallel_masked_taskloop_simd:
798 case OMPD_parallel_master_taskloop:
799 case OMPD_parallel_master_taskloop_simd:
800 CaptureRegions.push_back(OMPD_parallel);
801 CaptureRegions.push_back(OMPD_taskloop);
803 case OMPD_target_teams_distribute_parallel_for:
804 case OMPD_target_teams_distribute_parallel_for_simd:
805 CaptureRegions.push_back(OMPD_task);
806 CaptureRegions.push_back(OMPD_target);
807 CaptureRegions.push_back(OMPD_teams);
808 CaptureRegions.push_back(OMPD_parallel);
810 case OMPD_teams_loop:
811 CaptureRegions.push_back(OMPD_teams);
814 CaptureRegions.push_back(OMPD_nothing);
829 case OMPD_distribute:
832 case OMPD_target_data:
833 case OMPD_distribute_simd:
835 CaptureRegions.push_back(OMPD_unknown);
841 case OMPD_threadprivate:
847 case OMPD_cancellation_point:
852 case OMPD_declare_reduction:
853 case OMPD_declare_mapper:
854 case OMPD_declare_simd:
855 case OMPD_declare_target:
856 case OMPD_end_declare_target:
858 case OMPD_declare_variant:
859 case OMPD_begin_declare_variant:
860 case OMPD_end_declare_variant:
861 llvm_unreachable(
"OpenMP Directive is not allowed");
864 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 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.