15#include "llvm/ADT/StringRef.h"
16#include "llvm/ADT/StringSwitch.h"
17#include "llvm/Support/ErrorHandling.h"
21using namespace llvm::omp;
26 return llvm::StringSwitch<OpenMPDefaultClauseVariableCategory>(Str)
27#define OPENMP_DEFAULT_VARIABLE_CATEGORY(Name) \
28 .Case(#Name, OMPC_DEFAULT_VC_##Name)
29#include "clang/Basic/OpenMPKinds.def"
35#define OPENMP_DEFAULT_VARIABLE_CATEGORY(Name) \
36 case OMPC_DEFAULT_VC_##Name: \
38#include "clang/Basic/OpenMPKinds.def"
40 llvm_unreachable(
"Invalid Variable Category in the default clause");
47 return llvm::StringSwitch<unsigned>(Str)
48#define OMP_DEFAULT_KIND(Enum, Name) .Case(Name, unsigned(Enum))
49#include "llvm/Frontend/OpenMP/OMPKinds.def"
50 .Default(
unsigned(llvm::omp::OMP_DEFAULT_unknown));
52 return llvm::StringSwitch<unsigned>(Str)
53#define OMP_PROC_BIND_KIND(Enum, Name, Value) .Case(Name, Value)
54#include "llvm/Frontend/OpenMP/OMPKinds.def"
55 .Default(
unsigned(llvm::omp::OMP_PROC_BIND_unknown));
57 return llvm::StringSwitch<unsigned>(Str)
58#define OPENMP_SCHEDULE_KIND(Name) \
59 .Case(#Name, static_cast<unsigned>(OMPC_SCHEDULE_##Name))
60#define OPENMP_SCHEDULE_MODIFIER(Name) \
61 .Case(#Name, static_cast<unsigned>(OMPC_SCHEDULE_MODIFIER_##Name))
62#include "clang/Basic/OpenMPKinds.def"
65 unsigned Type = llvm::StringSwitch<unsigned>(Str)
66#define OPENMP_DEPEND_KIND(Name) .Case(#Name, OMPC_DEPEND_##Name)
67#include "clang/Basic/OpenMPKinds.def"
69 if (LangOpts.OpenMP < 51 &&
Type == OMPC_DEPEND_inoutset)
74 return llvm::StringSwitch<OpenMPDoacrossClauseModifier>(Str)
75#define OPENMP_DOACROSS_MODIFIER(Name) .Case(#Name, OMPC_DOACROSS_##Name)
76#include "clang/Basic/OpenMPKinds.def"
79 return llvm::StringSwitch<OpenMPLinearClauseKind>(Str)
80#define OPENMP_LINEAR_KIND(Name) .Case(#Name, OMPC_LINEAR_##Name)
81#include "clang/Basic/OpenMPKinds.def"
84 unsigned Type = llvm::StringSwitch<unsigned>(Str)
85#define OPENMP_MAP_KIND(Name) \
86 .Case(#Name, static_cast<unsigned>(OMPC_MAP_##Name))
87#define OPENMP_MAP_MODIFIER_KIND(Name) \
88 .Case(#Name, static_cast<unsigned>(OMPC_MAP_MODIFIER_##Name))
89#include "clang/Basic/OpenMPKinds.def"
91 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MAP_MODIFIER_present)
93 if (!LangOpts.OpenMPExtensions &&
Type == OMPC_MAP_MODIFIER_ompx_hold)
99 unsigned Type = llvm::StringSwitch<unsigned>(Str)
100#define OPENMP_MOTION_MODIFIER_KIND(Name) \
101 .Case(#Name, static_cast<unsigned>(OMPC_MOTION_MODIFIER_##Name))
102#include "clang/Basic/OpenMPKinds.def"
104 if (LangOpts.OpenMP < 51 &&
Type == OMPC_MOTION_MODIFIER_present)
108 case OMPC_dist_schedule:
109 return llvm::StringSwitch<OpenMPDistScheduleClauseKind>(Str)
110#define OPENMP_DIST_SCHEDULE_KIND(Name) .Case(#Name, OMPC_DIST_SCHEDULE_##Name)
111#include "clang/Basic/OpenMPKinds.def"
113 case OMPC_defaultmap: {
114 unsigned Type = llvm::StringSwitch<unsigned>(Str)
115#define OPENMP_DEFAULTMAP_KIND(Name) \
116 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_##Name))
117#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
118 .Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_MODIFIER_##Name))
119#include "clang/Basic/OpenMPKinds.def"
121 if (LangOpts.OpenMP < 60 && (
Type == OMPC_DEFAULTMAP_MODIFIER_storage ||
122 Type == OMPC_DEFAULTMAP_MODIFIER_private))
126 case OMPC_atomic_default_mem_order:
127 return llvm::StringSwitch<OpenMPAtomicDefaultMemOrderClauseKind>(Str)
128#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
129 .Case(#Name, OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name)
130#include "clang/Basic/OpenMPKinds.def"
133 return static_cast<unsigned int>(llvm::StringSwitch<llvm::omp::Clause>(Str)
134#define OPENMP_ATOMIC_FAIL_MODIFIER(Name) .Case(#Name, OMPC_##Name)
135#include "clang/Basic/OpenMPKinds.def"
136 .Default(OMPC_unknown));
137 case OMPC_device_type:
138 return llvm::StringSwitch<OpenMPDeviceType>(Str)
139#define OPENMP_DEVICE_TYPE_KIND(Name) .Case(#Name, OMPC_DEVICE_TYPE_##Name)
140#include "clang/Basic/OpenMPKinds.def"
143 return llvm::StringSwitch<OpenMPAtClauseKind>(Str)
144#define OPENMP_AT_KIND(Name) .Case(#Name, OMPC_AT_##Name)
145#include "clang/Basic/OpenMPKinds.def"
148 return llvm::StringSwitch<OpenMPSeverityClauseKind>(Str)
149#define OPENMP_SEVERITY_KIND(Name) .Case(#Name, OMPC_SEVERITY_##Name)
150#include "clang/Basic/OpenMPKinds.def"
152 case OMPC_lastprivate:
153 return llvm::StringSwitch<OpenMPLastprivateModifier>(Str)
154#define OPENMP_LASTPRIVATE_KIND(Name) .Case(#Name, OMPC_LASTPRIVATE_##Name)
155#include "clang/Basic/OpenMPKinds.def"
158 return llvm::StringSwitch<unsigned>(Str)
159#define OPENMP_ORDER_KIND(Name) \
160 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_##Name))
161#define OPENMP_ORDER_MODIFIER(Name) \
162 .Case(#Name, static_cast<unsigned>(OMPC_ORDER_MODIFIER_##Name))
163#include "clang/Basic/OpenMPKinds.def"
166 return llvm::StringSwitch<OpenMPDependClauseKind>(Str)
167#define OPENMP_DEPEND_KIND(Name) .Case(#Name, OMPC_DEPEND_##Name)
168#include "clang/Basic/OpenMPKinds.def"
171 return llvm::StringSwitch<OpenMPDeviceClauseModifier>(Str)
172#define OPENMP_DEVICE_MODIFIER(Name) .Case(#Name, OMPC_DEVICE_##Name)
173#include "clang/Basic/OpenMPKinds.def"
176 return llvm::StringSwitch<OpenMPReductionClauseModifier>(Str)
177#define OPENMP_REDUCTION_MODIFIER(Name) .Case(#Name, OMPC_REDUCTION_##Name)
178#include "clang/Basic/OpenMPKinds.def"
180 case OMPC_adjust_args:
181 return llvm::StringSwitch<OpenMPAdjustArgsOpKind>(Str)
182#define OPENMP_ADJUST_ARGS_KIND(Name) .Case(#Name, OMPC_ADJUST_ARGS_##Name)
183#include "clang/Basic/OpenMPKinds.def"
186 return llvm::StringSwitch<unsigned>(Str)
187#define OPENMP_BIND_KIND(Name) .Case(#Name, OMPC_BIND_##Name)
188#include "clang/Basic/OpenMPKinds.def"
190 case OMPC_grainsize: {
191 unsigned Type = llvm::StringSwitch<unsigned>(Str)
192#define OPENMP_GRAINSIZE_MODIFIER(Name) .Case(#Name, OMPC_GRAINSIZE_##Name)
193#include "clang/Basic/OpenMPKinds.def"
195 if (LangOpts.OpenMP < 51)
199 case OMPC_num_tasks: {
200 unsigned Type = llvm::StringSwitch<unsigned>(Str)
201#define OPENMP_NUMTASKS_MODIFIER(Name) .Case(#Name, OMPC_NUMTASKS_##Name)
202#include "clang/Basic/OpenMPKinds.def"
204 if (LangOpts.OpenMP < 51)
209 return llvm::StringSwitch<OpenMPAllocateClauseModifier>(Str)
210#define OPENMP_ALLOCATE_MODIFIER(Name) .Case(#Name, OMPC_ALLOCATE_##Name)
211#include "clang/Basic/OpenMPKinds.def"
213 case OMPC_num_threads: {
214 unsigned Type = llvm::StringSwitch<unsigned>(Str)
215#define OPENMP_NUMTHREADS_MODIFIER(Name) .Case(#Name, OMPC_NUMTHREADS_##Name)
216#include "clang/Basic/OpenMPKinds.def"
218 if (LangOpts.OpenMP < 60)
223 case OMPC_threadprivate:
224 case OMPC_groupprivate:
230 case OMPC_permutation:
234 case OMPC_firstprivate:
236 case OMPC_task_reduction:
237 case OMPC_in_reduction:
240 case OMPC_copyprivate:
259 case OMPC_thread_limit:
264 case OMPC_use_device_ptr:
265 case OMPC_use_device_addr:
266 case OMPC_is_device_ptr:
267 case OMPC_has_device_addr:
268 case OMPC_unified_address:
269 case OMPC_unified_shared_memory:
270 case OMPC_reverse_offload:
271 case OMPC_dynamic_allocators:
274 case OMPC_nontemporal:
276 case OMPC_novariants:
281 case OMPC_uses_allocators:
284 case OMPC_append_args:
289 llvm_unreachable(
"Invalid OpenMP simple clause kind");
296 switch (llvm::omp::DefaultKind(
Type)) {
297#define OMP_DEFAULT_KIND(Enum, Name) \
300#include "llvm/Frontend/OpenMP/OMPKinds.def"
302 llvm_unreachable(
"Invalid OpenMP 'default' clause type");
305#define OMP_PROC_BIND_KIND(Enum, Name, Value) \
308#include "llvm/Frontend/OpenMP/OMPKinds.def"
310 llvm_unreachable(
"Invalid OpenMP 'proc_bind' clause type");
316#define OPENMP_SCHEDULE_KIND(Name) \
317 case OMPC_SCHEDULE_##Name: \
319#define OPENMP_SCHEDULE_MODIFIER(Name) \
320 case OMPC_SCHEDULE_MODIFIER_##Name: \
322#include "clang/Basic/OpenMPKinds.def"
324 llvm_unreachable(
"Invalid OpenMP 'schedule' clause type");
329#define OPENMP_DEPEND_KIND(Name) \
330 case OMPC_DEPEND_##Name: \
332#include "clang/Basic/OpenMPKinds.def"
334 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
339#define OPENMP_DOACROSS_MODIFIER(Name) \
340 case OMPC_DOACROSS_##Name: \
342#include "clang/Basic/OpenMPKinds.def"
344 llvm_unreachable(
"Invalid OpenMP 'doacross' clause type");
349#define OPENMP_LINEAR_KIND(Name) \
350 case OMPC_LINEAR_##Name: \
352#include "clang/Basic/OpenMPKinds.def"
354 llvm_unreachable(
"Invalid OpenMP 'linear' clause type");
360#define OPENMP_MAP_KIND(Name) \
361 case OMPC_MAP_##Name: \
363#define OPENMP_MAP_MODIFIER_KIND(Name) \
364 case OMPC_MAP_MODIFIER_##Name: \
366#include "clang/Basic/OpenMPKinds.def"
370 llvm_unreachable(
"Invalid OpenMP 'map' clause type");
376#define OPENMP_MOTION_MODIFIER_KIND(Name) \
377 case OMPC_MOTION_MODIFIER_##Name: \
379#include "clang/Basic/OpenMPKinds.def"
383 llvm_unreachable(
"Invalid OpenMP 'to' or 'from' clause type");
384 case OMPC_dist_schedule:
388#define OPENMP_DIST_SCHEDULE_KIND(Name) \
389 case OMPC_DIST_SCHEDULE_##Name: \
391#include "clang/Basic/OpenMPKinds.def"
393 llvm_unreachable(
"Invalid OpenMP 'dist_schedule' clause type");
394 case OMPC_defaultmap:
399#define OPENMP_DEFAULTMAP_KIND(Name) \
400 case OMPC_DEFAULTMAP_##Name: \
402#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
403 case OMPC_DEFAULTMAP_MODIFIER_##Name: \
405#include "clang/Basic/OpenMPKinds.def"
407 llvm_unreachable(
"Invalid OpenMP 'defaultmap' clause type");
408 case OMPC_atomic_default_mem_order:
412#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
413 case OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name: \
415#include "clang/Basic/OpenMPKinds.def"
417 llvm_unreachable(
"Invalid OpenMP 'atomic_default_mem_order' clause type");
418 case OMPC_device_type:
422#define OPENMP_DEVICE_TYPE_KIND(Name) \
423 case OMPC_DEVICE_TYPE_##Name: \
425#include "clang/Basic/OpenMPKinds.def"
427 llvm_unreachable(
"Invalid OpenMP 'device_type' clause type");
432#define OPENMP_AT_KIND(Name) \
433 case OMPC_AT_##Name: \
435#include "clang/Basic/OpenMPKinds.def"
437 llvm_unreachable(
"Invalid OpenMP 'at' clause type");
442#define OPENMP_SEVERITY_KIND(Name) \
443 case OMPC_SEVERITY_##Name: \
445#include "clang/Basic/OpenMPKinds.def"
447 llvm_unreachable(
"Invalid OpenMP 'severity' clause type");
448 case OMPC_lastprivate:
452#define OPENMP_LASTPRIVATE_KIND(Name) \
453 case OMPC_LASTPRIVATE_##Name: \
455#include "clang/Basic/OpenMPKinds.def"
457 llvm_unreachable(
"Invalid OpenMP 'lastprivate' clause type");
463#define OPENMP_ORDER_KIND(Name) \
464 case OMPC_ORDER_##Name: \
466#define OPENMP_ORDER_MODIFIER(Name) \
467 case OMPC_ORDER_MODIFIER_##Name: \
469#include "clang/Basic/OpenMPKinds.def"
471 llvm_unreachable(
"Invalid OpenMP 'order' clause type");
476#define OPENMP_DEPEND_KIND(Name) \
477 case OMPC_DEPEND_##Name: \
479#include "clang/Basic/OpenMPKinds.def"
481 llvm_unreachable(
"Invalid OpenMP 'depend' clause type");
484 return getOpenMPClauseName(CK).data();
485 llvm_unreachable(
"Invalid OpenMP 'fail' clause modifier");
491#define OPENMP_DEVICE_MODIFIER(Name) \
492 case OMPC_DEVICE_##Name: \
494#include "clang/Basic/OpenMPKinds.def"
496 llvm_unreachable(
"Invalid OpenMP 'device' clause modifier");
501#define OPENMP_REDUCTION_MODIFIER(Name) \
502 case OMPC_REDUCTION_##Name: \
504#include "clang/Basic/OpenMPKinds.def"
506 llvm_unreachable(
"Invalid OpenMP 'reduction' clause modifier");
507 case OMPC_adjust_args:
511#define OPENMP_ADJUST_ARGS_KIND(Name) \
512 case OMPC_ADJUST_ARGS_##Name: \
514#include "clang/Basic/OpenMPKinds.def"
516 llvm_unreachable(
"Invalid OpenMP 'adjust_args' clause kind");
521#define OPENMP_BIND_KIND(Name) \
522 case OMPC_BIND_##Name: \
524#include "clang/Basic/OpenMPKinds.def"
526 llvm_unreachable(
"Invalid OpenMP 'bind' clause type");
531#define OPENMP_GRAINSIZE_MODIFIER(Name) \
532 case OMPC_GRAINSIZE_##Name: \
534#include "clang/Basic/OpenMPKinds.def"
536 llvm_unreachable(
"Invalid OpenMP 'grainsize' clause modifier");
541#define OPENMP_NUMTASKS_MODIFIER(Name) \
542 case OMPC_NUMTASKS_##Name: \
544#include "clang/Basic/OpenMPKinds.def"
546 llvm_unreachable(
"Invalid OpenMP 'num_tasks' clause modifier");
551#define OPENMP_ALLOCATE_MODIFIER(Name) \
552 case OMPC_ALLOCATE_##Name: \
554#include "clang/Basic/OpenMPKinds.def"
556 llvm_unreachable(
"Invalid OpenMP 'allocate' clause modifier");
557 case OMPC_num_threads:
561#define OPENMP_NUMTHREADS_MODIFIER(Name) \
562 case OMPC_NUMTHREADS_##Name: \
564#include "clang/Basic/OpenMPKinds.def"
566 llvm_unreachable(
"Invalid OpenMP 'num_threads' clause modifier");
568 case OMPC_threadprivate:
569 case OMPC_groupprivate:
575 case OMPC_permutation:
579 case OMPC_firstprivate:
581 case OMPC_task_reduction:
582 case OMPC_in_reduction:
585 case OMPC_copyprivate:
604 case OMPC_thread_limit:
609 case OMPC_use_device_ptr:
610 case OMPC_use_device_addr:
611 case OMPC_is_device_ptr:
612 case OMPC_has_device_addr:
613 case OMPC_unified_address:
614 case OMPC_unified_shared_memory:
615 case OMPC_reverse_offload:
616 case OMPC_dynamic_allocators:
619 case OMPC_nontemporal:
622 case OMPC_novariants:
626 case OMPC_uses_allocators:
629 case OMPC_append_args:
634 llvm_unreachable(
"Invalid OpenMP simple clause kind");
638 return getDirectiveAssociation(DKind) == Association::Loop;
642 return DKind == OMPD_for || DKind == OMPD_for_simd ||
643 DKind == OMPD_sections || DKind == OMPD_section ||
644 DKind == OMPD_single || DKind == OMPD_parallel_for ||
645 DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections ||
646 DKind == OMPD_target_parallel_for ||
647 DKind == OMPD_distribute_parallel_for ||
648 DKind == OMPD_distribute_parallel_for_simd ||
649 DKind == OMPD_target_parallel_for_simd ||
650 DKind == OMPD_teams_distribute_parallel_for_simd ||
651 DKind == OMPD_teams_distribute_parallel_for ||
652 DKind == OMPD_target_teams_distribute_parallel_for ||
653 DKind == OMPD_target_teams_distribute_parallel_for_simd ||
654 DKind == OMPD_parallel_loop || DKind == OMPD_teams_loop ||
655 DKind == OMPD_target_parallel_loop || DKind == OMPD_target_teams_loop;
659 return DKind == OMPD_taskloop ||
660 llvm::is_contained(getLeafConstructs(DKind), OMPD_taskloop);
664 if (DKind == OMPD_teams_loop)
666 return DKind == OMPD_parallel ||
667 llvm::is_contained(getLeafConstructs(DKind), OMPD_parallel);
671 return DKind == OMPD_target ||
672 llvm::is_contained(getLeafConstructs(DKind), OMPD_target);
676 return DKind == OMPD_target_data || DKind == OMPD_target_enter_data ||
677 DKind == OMPD_target_exit_data || DKind == OMPD_target_update;
681 if (DKind == OMPD_teams)
684 return !Leaves.empty() && Leaves.front() == OMPD_teams;
688 return DKind == OMPD_teams ||
689 llvm::is_contained(getLeafConstructs(DKind), OMPD_teams);
694 if (getDirectiveAssociation(DKind) != Association::Loop)
699 return DKind == OMPD_simd ||
700 llvm::is_contained(getLeafConstructs(DKind), OMPD_simd);
704 if (Kind == OMPD_distribute)
707 return !Leaves.empty() && Leaves.front() == OMPD_distribute;
711 return Kind == OMPD_distribute ||
712 llvm::is_contained(getLeafConstructs(Kind), OMPD_distribute);
716 if (Kind == OMPD_loop)
719 return !Leaves.empty() && Leaves.back() == OMPD_loop;
723 return Kind == OMPC_private || Kind == OMPC_firstprivate ||
724 Kind == OMPC_lastprivate || Kind == OMPC_linear ||
725 Kind == OMPC_reduction || Kind == OMPC_task_reduction ||
726 Kind == OMPC_in_reduction;
730 return Kind == OMPC_threadprivate || Kind == OMPC_copyin;
738 return Kind == OMPD_distribute_parallel_for ||
739 Kind == OMPD_distribute_parallel_for_simd ||
740 Kind == OMPD_teams_distribute_parallel_for_simd ||
741 Kind == OMPD_teams_distribute_parallel_for ||
742 Kind == OMPD_target_teams_distribute_parallel_for ||
743 Kind == OMPD_target_teams_distribute_parallel_for_simd ||
744 Kind == OMPD_teams_loop || Kind == OMPD_target_teams_loop;
749 return DKind == OMPD_tile || DKind == OMPD_unroll || DKind == OMPD_reverse ||
750 DKind == OMPD_interchange || DKind == OMPD_stripe;
759 return DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
760 DKind == OMPD_parallel_master ||
761 DKind == OMPD_parallel_master_taskloop ||
762 DKind == OMPD_parallel_master_taskloop_simd ||
763 DKind == OMPD_parallel_sections;
767 return DKind == OMPD_target || DKind == OMPD_target_parallel ||
768 DKind == OMPD_target_parallel_for ||
769 DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
770 DKind == OMPD_target_parallel_loop;
774 if (DKind == OMPD_error)
776 Category Cat = getDirectiveCategory(DKind);
777 return Cat == Category::Executable || Cat == Category::Subsidiary;
781 if (DKind == OMPD_error)
783 Category Cat = getDirectiveCategory(DKind);
784 return Cat == Category::Informational;
793 case OMPD_cancellation_point:
811 case OMPD_metadirective:
826 if (DKind == OMPD_loop || DKind == OMPD_parallel || DKind == OMPD_simd ||
830 if (LangOpts.OpenMP >= 60)
831 return DKind == OMPD_atomic ||
840 assert(
unsigned(DKind) < llvm::omp::Directive_enumSize);
844 assert(isLeafConstruct(LKind) &&
"Epecting leaf directive");
847 case OMPD_metadirective:
848 CaptureRegions.push_back(OMPD_metadirective);
851 CaptureRegions.push_back(OMPD_nothing);
854 CaptureRegions.push_back(OMPD_parallel);
857 CaptureRegions.push_back(OMPD_task);
858 CaptureRegions.push_back(OMPD_target);
861 case OMPD_target_enter_data:
862 case OMPD_target_exit_data:
863 case OMPD_target_update:
864 CaptureRegions.push_back(OMPD_task);
867 CaptureRegions.push_back(OMPD_teams);
870 CaptureRegions.push_back(OMPD_taskloop);
877 if (!CaptureRegions.empty() &&
878 !llvm::is_contained(CaptureRegions, OMPD_parallel))
879 CaptureRegions.push_back(OMPD_parallel);
884 case OMPD_distribute:
891 case OMPD_target_data:
903 llvm::errs() << getOpenMPDirectiveName(LKind, llvm::omp::FallbackVersion)
905 llvm_unreachable(
"Unexpected directive");
910 bool MayNeedUnknownRegion =
false;
912 MayNeedUnknownRegion |= GetRegionsForLeaf(L);
917 if (CaptureRegions.empty() && MayNeedUnknownRegion)
918 CaptureRegions.push_back(OMPD_unknown);
922 assert((CaptureRegions[0] == OMPD_unknown ||
923 !llvm::is_contained(CaptureRegions, OMPD_unknown)) &&
924 "Misplaced OMPD_unknown");
928 return FailClauseParameter == llvm::omp::OMPC_acquire ||
929 FailClauseParameter == llvm::omp::OMPC_relaxed ||
930 FailClauseParameter == llvm::omp::OMPC_seq_cst;
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.
The JSON file list parser is used to communicate input to InstallAPI.
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 checkFailClauseParameter(OpenMPClauseKind FailClauseParameter)
Checks if the parameter to the fail clause in "#pragma atomic compare fail" is restricted only to mem...
bool isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target data offload directive.
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
@ OMPC_DEFAULT_VC_unknown
bool isOpenMPLoopTransformationDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a loop transformation directive.
@ OMPC_DEFAULTMAP_MODIFIER_last
@ OMPC_DEFAULTMAP_MODIFIER_unknown
@ 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
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 isOpenMPCanonicalLoopNestTransformationDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a loop transformation directive that applies to a canonical loop...
bool isOpenMPOrderConcurrentNestableDirective(OpenMPDirectiveKind DKind, const LangOptions &LangOpts)
Checks if the specified directive is an order concurrent nestable directive that can be nested within...
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
bool isOpenMPCapturingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive can capture variables.
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 isOpenMPExecutableDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is considered as "executable".
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
bool isOpenMPInformationalDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is considered as "informational".
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_NUMTHREADS_unknown
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
const char * getOpenMPDefaultVariableCategoryName(unsigned VC)
@ 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...
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
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.
OpenMPDefaultClauseVariableCategory getOpenMPDefaultVariableCategory(StringRef Str, const LangOptions &LangOpts)