23#include "llvm/ADT/Sequence.h"
24#include "llvm/ADT/SmallPtrSet.h"
25#include "llvm/Support/ErrorHandling.h"
38#define GEN_CLANG_CLAUSE_CLASS
39#define CLAUSE_CLASS(Enum, Str, Class) \
41 return static_cast<Class *>(this)->children();
42#include "llvm/Frontend/OpenMP/OMP.inc"
44 llvm_unreachable(
"unknown OMPClause");
49#define GEN_CLANG_CLAUSE_CLASS
50#define CLAUSE_CLASS(Enum, Str, Class) \
52 return static_cast<Class *>(this)->used_children();
53#define CLAUSE_NO_CLASS(Enum, Str) \
56#include "llvm/Frontend/OpenMP/OMP.inc"
58 llvm_unreachable(
"unknown OMPClause");
67 switch (
C->getClauseKind()) {
69 return static_cast<const OMPScheduleClause *
>(
C);
70 case OMPC_dist_schedule:
72 case OMPC_firstprivate:
73 return static_cast<const OMPFirstprivateClause *
>(
C);
74 case OMPC_lastprivate:
75 return static_cast<const OMPLastprivateClause *
>(
C);
77 return static_cast<const OMPReductionClause *
>(
C);
78 case OMPC_task_reduction:
79 return static_cast<const OMPTaskReductionClause *
>(
C);
80 case OMPC_in_reduction:
81 return static_cast<const OMPInReductionClause *
>(
C);
83 return static_cast<const OMPLinearClause *
>(
C);
86 case OMPC_num_threads:
90 case OMPC_thread_limit:
102 case OMPC_novariants:
108 case OMPC_ompx_dyn_cgroup_mem:
110 case OMPC_dyn_groupprivate:
113 return static_cast<const OMPMessageClause *
>(
C);
114 case OMPC_transparent:
115 return static_cast<const OMPTransparentClause *
>(
C);
128 case OMPC_copyprivate:
134 case OMPC_threadprivate:
135 case OMPC_groupprivate:
155 case OMPC_defaultmap:
160 case OMPC_use_device_ptr:
161 case OMPC_use_device_addr:
162 case OMPC_is_device_ptr:
163 case OMPC_has_device_addr:
164 case OMPC_unified_address:
165 case OMPC_unified_shared_memory:
166 case OMPC_reverse_offload:
167 case OMPC_dynamic_allocators:
168 case OMPC_atomic_default_mem_order:
172 case OMPC_device_type:
174 case OMPC_nontemporal:
180 case OMPC_uses_allocators:
199 switch (
C->getClauseKind()) {
200 case OMPC_lastprivate:
201 return static_cast<const OMPLastprivateClause *
>(
C);
203 return static_cast<const OMPReductionClause *
>(
C);
204 case OMPC_task_reduction:
205 return static_cast<const OMPTaskReductionClause *
>(
C);
206 case OMPC_in_reduction:
207 return static_cast<const OMPInReductionClause *
>(
C);
209 return static_cast<const OMPLinearClause *
>(
C);
211 case OMPC_dist_schedule:
212 case OMPC_firstprivate:
217 case OMPC_num_threads:
228 case OMPC_copyprivate:
233 case OMPC_threadprivate:
234 case OMPC_groupprivate:
254 case OMPC_thread_limit:
260 case OMPC_defaultmap:
265 case OMPC_use_device_ptr:
266 case OMPC_use_device_addr:
267 case OMPC_is_device_ptr:
268 case OMPC_has_device_addr:
269 case OMPC_unified_address:
270 case OMPC_unified_shared_memory:
271 case OMPC_reverse_offload:
272 case OMPC_dynamic_allocators:
273 case OMPC_atomic_default_mem_order:
278 case OMPC_device_type:
280 case OMPC_nontemporal:
283 case OMPC_novariants:
288 case OMPC_uses_allocators:
305 if (
auto *DS = dyn_cast<DeclStmt>(S)) {
306 assert(DS->isSingleDecl() &&
"Only single expression must be captured.");
307 if (
auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
308 return OED->getInitAddress();
327 return child_range(
C,
C + 1);
328 return child_range(&Grainsize, &Grainsize + 1);
333 return child_range(
C,
C + 1);
334 return child_range(&NumTasks, &NumTasks + 1);
345 return child_range(
C,
C + 1);
346 return child_range(&Priority, &Priority + 1);
351 return child_range(
C,
C + 1);
357 return child_range(
C,
C + 1);
366 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
368 new (Mem) OMPOrderedClause(
Num, NumLoops, StartLoc, LParenLoc, EndLoc);
369 for (
unsigned I = 0; I < NumLoops; ++I) {
370 Clause->setLoopNumIterations(I,
nullptr);
371 Clause->setLoopCounter(I,
nullptr);
376OMPOrderedClause *OMPOrderedClause::CreateEmpty(
const ASTContext &
C,
378 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
379 auto *Clause =
new (Mem) OMPOrderedClause(NumLoops);
380 for (
unsigned I = 0; I < NumLoops; ++I) {
381 Clause->setLoopNumIterations(I,
nullptr);
382 Clause->setLoopCounter(I,
nullptr);
387void OMPOrderedClause::setLoopNumIterations(
unsigned NumLoop,
388 Expr *NumIterations) {
389 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
390 getTrailingObjects()[NumLoop] = NumIterations;
394 return getTrailingObjects(NumberOfLoops);
397void OMPOrderedClause::setLoopCounter(
unsigned NumLoop,
Expr *Counter) {
398 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
399 getTrailingObjects()[NumberOfLoops + NumLoop] = Counter;
402Expr *OMPOrderedClause::getLoopCounter(
unsigned NumLoop) {
403 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
404 return getTrailingObjects()[NumberOfLoops + NumLoop];
407const Expr *OMPOrderedClause::getLoopCounter(
unsigned NumLoop)
const {
408 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
409 return getTrailingObjects()[NumberOfLoops + NumLoop];
412OMPUpdateDependObjectsClause *OMPUpdateDependObjectsClause::Create(
417 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
418 alignof(OMPUpdateDependObjectsClause));
419 auto *Clause =
new (Mem) OMPUpdateDependObjectsClause(StartLoc, EndLoc);
420 Clause->setLParenLoc(LParenLoc);
421 Clause->setArgumentLoc(ArgumentLoc);
422 Clause->setDependencyKind(DK);
426OMPUpdateDependObjectsClause *
427OMPUpdateDependObjectsClause::CreateEmpty(
const ASTContext &
C) {
429 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
430 alignof(OMPUpdateDependObjectsClause));
431 auto *Clause =
new (Mem) OMPUpdateDependObjectsClause();
436 assert(VL.size() == varlist_size() &&
437 "Number of private copies is not the same as the preallocated buffer");
438 llvm::copy(VL, varlist_end());
446 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
447 OMPPrivateClause *Clause =
448 new (Mem) OMPPrivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
449 Clause->setVarRefs(VL);
450 Clause->setPrivateCopies(PrivateVL);
454OMPPrivateClause *OMPPrivateClause::CreateEmpty(
const ASTContext &
C,
456 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
457 return new (Mem) OMPPrivateClause(N);
461 assert(VL.size() == varlist_size() &&
462 "Number of private copies is not the same as the preallocated buffer");
463 llvm::copy(VL, varlist_end());
467 assert(VL.size() == varlist_size() &&
468 "Number of inits is not the same as the preallocated buffer");
469 llvm::copy(VL, getPrivateCopies().end());
472OMPFirstprivateClause *
477 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
478 OMPFirstprivateClause *Clause =
479 new (Mem) OMPFirstprivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
480 Clause->setVarRefs(VL);
481 Clause->setPrivateCopies(PrivateVL);
482 Clause->setInits(InitVL);
483 Clause->setPreInitStmt(PreInit);
487OMPFirstprivateClause *OMPFirstprivateClause::CreateEmpty(
const ASTContext &
C,
489 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * N));
490 return new (Mem) OMPFirstprivateClause(N);
493void OMPLastprivateClause::setPrivateCopies(
ArrayRef<Expr *> PrivateCopies) {
494 assert(PrivateCopies.size() == varlist_size() &&
495 "Number of private copies is not the same as the preallocated buffer");
496 llvm::copy(PrivateCopies, varlist_end());
500 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is "
501 "not the same as the "
502 "preallocated buffer");
503 llvm::copy(SrcExprs, getPrivateCopies().end());
507 assert(DstExprs.size() == varlist_size() &&
"Number of destination "
508 "expressions is not the same as "
509 "the preallocated buffer");
510 llvm::copy(DstExprs, getSourceExprs().end());
513void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
514 assert(AssignmentOps.size() == varlist_size() &&
515 "Number of assignment expressions is not the same as the preallocated "
517 llvm::copy(AssignmentOps, getDestinationExprs().end());
520OMPLastprivateClause *OMPLastprivateClause::Create(
526 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
527 OMPLastprivateClause *Clause =
new (Mem) OMPLastprivateClause(
528 StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size());
529 Clause->setVarRefs(VL);
530 Clause->setSourceExprs(SrcExprs);
531 Clause->setDestinationExprs(DstExprs);
532 Clause->setAssignmentOps(AssignmentOps);
533 Clause->setPreInitStmt(PreInit);
534 Clause->setPostUpdateExpr(PostUpdate);
538OMPLastprivateClause *OMPLastprivateClause::CreateEmpty(
const ASTContext &
C,
540 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
541 return new (Mem) OMPLastprivateClause(N);
544OMPSharedClause *OMPSharedClause::Create(
const ASTContext &
C,
549 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
550 OMPSharedClause *Clause =
551 new (Mem) OMPSharedClause(StartLoc, LParenLoc, EndLoc, VL.size());
552 Clause->setVarRefs(VL);
556OMPSharedClause *OMPSharedClause::CreateEmpty(
const ASTContext &
C,
unsigned N) {
557 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
558 return new (Mem) OMPSharedClause(N);
562 assert(PL.size() == varlist_size() &&
563 "Number of privates is not the same as the preallocated buffer");
564 llvm::copy(PL, varlist_end());
568 assert(IL.size() == varlist_size() &&
569 "Number of inits is not the same as the preallocated buffer");
574 assert(UL.size() == varlist_size() &&
575 "Number of updates is not the same as the preallocated buffer");
580 assert(FL.size() == varlist_size() &&
581 "Number of final updates is not the same as the preallocated buffer");
587 UE.size() == varlist_size() + 1 &&
588 "Number of used expressions is not the same as the preallocated buffer");
592OMPLinearClause *OMPLinearClause::Create(
602 C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2 + VL.size() + 1));
603 OMPLinearClause *Clause =
604 new (Mem) OMPLinearClause(StartLoc, LParenLoc, Modifier, ModifierLoc,
605 ColonLoc, StepModifierLoc, EndLoc, VL.size());
606 Clause->setVarRefs(VL);
607 Clause->setPrivates(PL);
608 Clause->setInits(IL);
611 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
613 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
615 std::fill(Clause->getUsedExprs().begin(), Clause->getUsedExprs().end(),
617 Clause->setStep(Step);
618 Clause->setCalcStep(CalcStep);
619 Clause->setPreInitStmt(PreInit);
620 Clause->setPostUpdateExpr(PostUpdate);
624OMPLinearClause *OMPLinearClause::CreateEmpty(
const ASTContext &
C,
628 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2 + NumVars +1));
629 return new (Mem) OMPLinearClause(NumVars);
643 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
644 OMPAlignedClause *Clause =
new (Mem)
645 OMPAlignedClause(StartLoc, LParenLoc, ColonLoc, EndLoc, VL.size());
646 Clause->setVarRefs(VL);
647 Clause->setAlignment(A);
653 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
654 return new (Mem) OMPAlignedClause(NumVars);
658 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is "
659 "not the same as the "
660 "preallocated buffer");
661 llvm::copy(SrcExprs, varlist_end());
665 assert(DstExprs.size() == varlist_size() &&
"Number of destination "
666 "expressions is not the same as "
667 "the preallocated buffer");
668 llvm::copy(DstExprs, getSourceExprs().end());
672 assert(AssignmentOps.size() == varlist_size() &&
673 "Number of assignment expressions is not the same as the preallocated "
675 llvm::copy(AssignmentOps, getDestinationExprs().end());
682 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
683 OMPCopyinClause *Clause =
684 new (Mem) OMPCopyinClause(StartLoc, LParenLoc, EndLoc, VL.size());
685 Clause->setVarRefs(VL);
686 Clause->setSourceExprs(SrcExprs);
687 Clause->setDestinationExprs(DstExprs);
688 Clause->setAssignmentOps(AssignmentOps);
693 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
694 return new (Mem) OMPCopyinClause(N);
698 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is "
699 "not the same as the "
700 "preallocated buffer");
701 llvm::copy(SrcExprs, varlist_end());
705 assert(DstExprs.size() == varlist_size() &&
"Number of destination "
706 "expressions is not the same as "
707 "the preallocated buffer");
708 llvm::copy(DstExprs, getSourceExprs().end());
711void OMPCopyprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
712 assert(AssignmentOps.size() == varlist_size() &&
713 "Number of assignment expressions is not the same as the preallocated "
715 llvm::copy(AssignmentOps, getDestinationExprs().end());
722 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
723 OMPCopyprivateClause *Clause =
724 new (Mem) OMPCopyprivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
725 Clause->setVarRefs(VL);
726 Clause->setSourceExprs(SrcExprs);
727 Clause->setDestinationExprs(DstExprs);
728 Clause->setAssignmentOps(AssignmentOps);
734 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
735 return new (Mem) OMPCopyprivateClause(N);
739 assert(
Privates.size() == varlist_size() &&
740 "Number of private copies is not the same as the preallocated buffer");
741 llvm::copy(
Privates, varlist_end());
746 LHSExprs.size() == varlist_size() &&
747 "Number of LHS expressions is not the same as the preallocated buffer");
753 RHSExprs.size() == varlist_size() &&
754 "Number of RHS expressions is not the same as the preallocated buffer");
755 llvm::copy(RHSExprs, getLHSExprs().end());
759 assert(ReductionOps.size() == varlist_size() &&
"Number of reduction "
760 "expressions is not the same "
761 "as the preallocated buffer");
762 llvm::copy(ReductionOps, getRHSExprs().end());
766 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
767 assert(Ops.size() == varlist_size() &&
"Number of copy "
768 "expressions is not the same "
769 "as the preallocated buffer");
770 llvm::copy(Ops, getReductionOps().end());
773void OMPReductionClause::setInscanCopyArrayTemps(
775 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
776 assert(CopyArrayTemps.size() == varlist_size() &&
777 "Number of copy temp expressions is not the same as the preallocated "
779 llvm::copy(CopyArrayTemps, getInscanCopyOps().end());
782void OMPReductionClause::setInscanCopyArrayElems(
784 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
785 assert(CopyArrayElems.size() == varlist_size() &&
786 "Number of copy temp expressions is not the same as the preallocated "
788 llvm::copy(CopyArrayElems, getInscanCopyArrayTemps().end());
791OMPReductionClause *OMPReductionClause::Create(
802 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, bool>(
803 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * VL.size(), VL.size()));
804 auto *Clause =
new (Mem) OMPReductionClause(
805 StartLoc, LParenLoc, ModifierLoc, EndLoc, ColonLoc, Modifier,
806 OrignalSharingModifier, VL.size(), QualifierLoc, NameInfo);
807 Clause->setVarRefs(VL);
809 Clause->setLHSExprs(LHSExprs);
810 Clause->setRHSExprs(RHSExprs);
811 Clause->setReductionOps(ReductionOps);
812 Clause->setPreInitStmt(PreInit);
813 Clause->setPostUpdateExpr(PostUpdate);
814 Clause->setPrivateVariableReductionFlags(IsPrivateVarReduction);
815 if (Modifier == OMPC_REDUCTION_inscan) {
816 Clause->setInscanCopyOps(CopyOps);
817 Clause->setInscanCopyArrayTemps(CopyArrayTemps);
818 Clause->setInscanCopyArrayElems(CopyArrayElems);
820 assert(CopyOps.empty() &&
821 "copy operations are expected in inscan reductions only.");
822 assert(CopyArrayTemps.empty() &&
823 "copy array temps are expected in inscan reductions only.");
824 assert(CopyArrayElems.empty() &&
825 "copy array temps are expected in inscan reductions only.");
831OMPReductionClause::CreateEmpty(
const ASTContext &
C,
unsigned N,
833 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, bool>(
834 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * N, N));
835 auto *Clause =
new (Mem) OMPReductionClause(N);
836 Clause->setModifier(Modifier);
841 assert(
Privates.size() == varlist_size() &&
842 "Number of private copies is not the same as the preallocated buffer");
843 llvm::copy(
Privates, varlist_end());
848 LHSExprs.size() == varlist_size() &&
849 "Number of LHS expressions is not the same as the preallocated buffer");
855 RHSExprs.size() == varlist_size() &&
856 "Number of RHS expressions is not the same as the preallocated buffer");
857 llvm::copy(RHSExprs, getLHSExprs().end());
860void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
861 assert(ReductionOps.size() == varlist_size() &&
"Number of task reduction "
862 "expressions is not the same "
863 "as the preallocated buffer");
864 llvm::copy(ReductionOps, getRHSExprs().end());
867OMPTaskReductionClause *OMPTaskReductionClause::Create(
874 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
875 OMPTaskReductionClause *Clause =
new (Mem) OMPTaskReductionClause(
876 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
877 Clause->setVarRefs(VL);
879 Clause->setLHSExprs(LHSExprs);
880 Clause->setRHSExprs(RHSExprs);
881 Clause->setReductionOps(ReductionOps);
882 Clause->setPreInitStmt(PreInit);
883 Clause->setPostUpdateExpr(PostUpdate);
887OMPTaskReductionClause *OMPTaskReductionClause::CreateEmpty(
const ASTContext &
C,
889 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
890 return new (Mem) OMPTaskReductionClause(N);
894 assert(
Privates.size() == varlist_size() &&
895 "Number of private copies is not the same as the preallocated buffer");
896 llvm::copy(
Privates, varlist_end());
901 LHSExprs.size() == varlist_size() &&
902 "Number of LHS expressions is not the same as the preallocated buffer");
908 RHSExprs.size() == varlist_size() &&
909 "Number of RHS expressions is not the same as the preallocated buffer");
910 llvm::copy(RHSExprs, getLHSExprs().end());
914 assert(ReductionOps.size() == varlist_size() &&
"Number of in reduction "
915 "expressions is not the same "
916 "as the preallocated buffer");
917 llvm::copy(ReductionOps, getRHSExprs().end());
920void OMPInReductionClause::setTaskgroupDescriptors(
922 assert(TaskgroupDescriptors.size() == varlist_size() &&
923 "Number of in reduction descriptors is not the same as the "
924 "preallocated buffer");
925 llvm::copy(TaskgroupDescriptors, getReductionOps().end());
928OMPInReductionClause *OMPInReductionClause::Create(
935 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
936 OMPInReductionClause *Clause =
new (Mem) OMPInReductionClause(
937 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
938 Clause->setVarRefs(VL);
940 Clause->setLHSExprs(LHSExprs);
941 Clause->setRHSExprs(RHSExprs);
942 Clause->setReductionOps(ReductionOps);
943 Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
944 Clause->setPreInitStmt(PreInit);
945 Clause->setPostUpdateExpr(PostUpdate);
949OMPInReductionClause *OMPInReductionClause::CreateEmpty(
const ASTContext &
C,
951 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * N));
952 return new (Mem) OMPInReductionClause(N);
961 Clause->setLocStart(StartLoc);
962 Clause->setLParenLoc(LParenLoc);
963 Clause->setLocEnd(EndLoc);
964 Clause->setSizesRefs(Sizes);
970 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumSizes));
971 return new (Mem) OMPSizesClause(NumSizes);
978 OMPCountsClause *Clause =
CreateEmpty(
C, Counts.size());
979 Clause->setLocStart(StartLoc);
980 Clause->setLParenLoc(LParenLoc);
981 Clause->setLocEnd(EndLoc);
982 Clause->setCountsRefs(Counts);
983 Clause->setOmpFillIndex(FillIdx);
984 Clause->setOmpFillLoc(FillLoc);
989 unsigned NumCounts) {
990 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumCounts));
991 return new (Mem) OMPCountsClause(NumCounts);
999 OMPPermutationClause *Clause =
CreateEmpty(
C, Args.size());
1000 Clause->setLocStart(StartLoc);
1001 Clause->setLParenLoc(LParenLoc);
1002 Clause->setLocEnd(EndLoc);
1003 Clause->setArgRefs(Args);
1008 unsigned NumLoops) {
1009 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumLoops));
1010 return new (Mem) OMPPermutationClause(NumLoops);
1021 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1022 auto *Clause =
new (Mem) OMPAllocateClause(
1023 StartLoc, LParenLoc, Allocator, Alignment, ColonLoc, Modifier1,
1024 Modifier1Loc, Modifier2, Modifier2Loc, EndLoc, VL.size());
1026 Clause->setVarRefs(VL);
1032 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1033 return new (Mem) OMPAllocateClause(N);
1041 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1042 OMPFlushClause *Clause =
1043 new (Mem) OMPFlushClause(StartLoc, LParenLoc, EndLoc, VL.size());
1044 Clause->setVarRefs(VL);
1049 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1050 return new (Mem) OMPFlushClause(N);
1058 void *Mem =
C.Allocate(
1059 totalSizeToAlloc<Expr *>(VL.size() + 1 + NumLoops),
1060 alignof(OMPDependClause));
1061 OMPDependClause *Clause =
new (Mem)
1062 OMPDependClause(StartLoc, LParenLoc, EndLoc, VL.size(), NumLoops);
1063 Clause->setDependencyKind(Data.DepKind);
1064 Clause->setDependencyLoc(Data.DepLoc);
1065 Clause->setColonLoc(Data.ColonLoc);
1066 Clause->setOmpAllMemoryLoc(Data.OmpAllMemoryLoc);
1067 Clause->setModifier(DepModifier);
1068 Clause->setVarRefs(VL);
1069 for (
unsigned I = 0 ; I < NumLoops; ++I)
1070 Clause->setLoopData(I,
nullptr);
1075 unsigned NumLoops) {
1077 C.Allocate(totalSizeToAlloc<Expr *>(N + 1 + NumLoops),
1078 alignof(OMPDependClause));
1079 return new (Mem) OMPDependClause(N, NumLoops);
1085 NumLoop < NumLoops &&
1086 "Expected sink or source depend + loop index must be less number of "
1088 auto *It = std::next(getVarRefs().end(), NumLoop + 1);
1095 NumLoop < NumLoops &&
1096 "Expected sink or source depend + loop index must be less number of "
1098 auto *It = std::next(getVarRefs().end(), NumLoop + 1);
1105 NumLoop < NumLoops &&
1106 "Expected sink or source depend + loop index must be less number of "
1108 const auto *It = std::next(getVarRefs().end(), NumLoop + 1);
1112void OMPDependClause::setModifier(
Expr *DepModifier) {
1113 *getVarRefs().end() = DepModifier;
1119 unsigned TotalNum = 0u;
1120 for (
auto &
C : ComponentLists)
1121 TotalNum +=
C.size();
1128 for (
const ValueDecl *D : Declarations) {
1130 UniqueDecls.insert(VD);
1132 return UniqueDecls.size();
1138 "Cannot get element-type from array-shaping expr.");
1152 if (
const auto *ATy = BaseType->getAsArrayTypeUnsafe())
1153 ElemTy = ATy->getElementType();
1161std::pair<const Expr *, std::optional<size_t>>
1167 if (Components.size() < 2)
1168 return {
nullptr, std::nullopt};
1173 if (Components.back().isNonContiguous() && CurDirKind == OMPD_target_update)
1174 return {
nullptr, std::nullopt};
1180 for (
auto [I, Component] : llvm::enumerate(Components)) {
1185 const Expr *CurExpr = Component.getAssociatedExpression();
1200 return {CurExpr, Components.size() - I};
1203 return {
nullptr, std::nullopt};
1230 void *Mem =
C.Allocate(
1236 OMPMapClause *Clause =
new (Mem)
1237 OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId,
1240 Clause->setVarRefs(Vars);
1241 Clause->setUDMapperRefs(UDMapperRefs);
1242 Clause->setIteratorModifier(IteratorModifier);
1243 Clause->setClauseInfo(Declarations, ComponentLists);
1244 Clause->setMapType(
Type);
1252 void *Mem =
C.Allocate(
1258 OMPMapClause *Clause =
new (Mem) OMPMapClause(Sizes);
1259 Clause->setIteratorModifier(
nullptr);
1286 void *Mem =
C.Allocate(
1293 auto *Clause =
new (Mem) OMPToClause(MotionModifiers, MotionModifiersLoc,
1294 UDMQualifierLoc, MapperId, Locs, Sizes);
1296 Clause->setVarRefs(Vars);
1297 Clause->setUDMapperRefs(UDMapperRefs);
1298 Clause->setClauseInfo(Declarations, ComponentLists);
1299 Clause->setIteratorModifier(IteratorModifier);
1305 void *Mem =
C.Allocate(
1311 OMPToClause *Clause =
new (Mem) OMPToClause(Sizes);
1312 Clause->setIteratorModifier(
nullptr);
1339 void *Mem =
C.Allocate(
1347 new (Mem) OMPFromClause(MotionModifiers, MotionModifiersLoc,
1348 UDMQualifierLoc, MapperId, Locs, Sizes);
1350 Clause->setVarRefs(Vars);
1351 Clause->setUDMapperRefs(UDMapperRefs);
1352 Clause->setClauseInfo(Declarations, ComponentLists);
1353 Clause->setIteratorModifier(IteratorModifier);
1360 void *Mem =
C.Allocate(
1366 OMPFromClause *Clause =
new (Mem) OMPFromClause(Sizes);
1367 Clause->setIteratorModifier(
nullptr);
1372 assert(VL.size() == varlist_size() &&
1373 "Number of private copies is not the same as the preallocated buffer");
1374 llvm::copy(VL, varlist_end());
1378 assert(VL.size() == varlist_size() &&
1379 "Number of inits is not the same as the preallocated buffer");
1380 llvm::copy(VL, getPrivateCopies().end());
1406 void *Mem =
C.Allocate(
1413 OMPUseDevicePtrClause *Clause =
new (Mem)
1414 OMPUseDevicePtrClause(Locs, Sizes, FallbackModifier, FallbackModifierLoc);
1416 Clause->setVarRefs(Vars);
1417 Clause->setPrivateCopies(PrivateVars);
1418 Clause->setInits(
Inits);
1419 Clause->setClauseInfo(Declarations, ComponentLists);
1426 void *Mem =
C.Allocate(
1432 return new (Mem) OMPUseDevicePtrClause(Sizes);
1456 void *Mem =
C.Allocate(
1463 auto *Clause =
new (Mem) OMPUseDeviceAddrClause(Locs, Sizes);
1465 Clause->setVarRefs(Vars);
1466 Clause->setClauseInfo(Declarations, ComponentLists);
1473 void *Mem =
C.Allocate(
1479 return new (Mem) OMPUseDeviceAddrClause(Sizes);
1503 void *Mem =
C.Allocate(
1510 OMPIsDevicePtrClause *Clause =
new (Mem) OMPIsDevicePtrClause(Locs, Sizes);
1512 Clause->setVarRefs(Vars);
1513 Clause->setClauseInfo(Declarations, ComponentLists);
1520 void *Mem =
C.Allocate(
1526 return new (Mem) OMPIsDevicePtrClause(Sizes);
1550 void *Mem =
C.Allocate(
1557 auto *Clause =
new (Mem) OMPHasDeviceAddrClause(Locs, Sizes);
1559 Clause->setVarRefs(Vars);
1560 Clause->setClauseInfo(Declarations, ComponentLists);
1567 void *Mem =
C.Allocate(
1573 return new (Mem) OMPHasDeviceAddrClause(Sizes);
1582 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
1584 new (Mem) OMPNontemporalClause(StartLoc, LParenLoc, EndLoc, VL.size());
1585 Clause->setVarRefs(VL);
1591 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
1592 return new (Mem) OMPNontemporalClause(N);
1596 assert(VL.size() == varlist_size() &&
"Number of private references is not "
1597 "the same as the preallocated buffer");
1598 llvm::copy(VL, varlist_end());
1606 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1608 new (Mem) OMPInclusiveClause(StartLoc, LParenLoc, EndLoc, VL.size());
1609 Clause->setVarRefs(VL);
1615 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1616 return new (Mem) OMPInclusiveClause(N);
1624 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1626 new (Mem) OMPExclusiveClause(StartLoc, LParenLoc, EndLoc, VL.size());
1627 Clause->setVarRefs(VL);
1633 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1634 return new (Mem) OMPExclusiveClause(N);
1637void OMPUsesAllocatorsClause::setAllocatorsData(
1639 assert(
Data.size() == NumOfAllocators &&
1640 "Size of allocators data is not the same as the preallocated buffer.");
1641 for (
unsigned I = 0, E =
Data.size(); I < E; ++I) {
1643 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1644 static_cast<int>(ExprOffsets::Allocator)] =
1646 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1648 ExprOffsets::AllocatorTraits)] =
1651 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1652 static_cast<int>(ParenLocsOffsets::LParen)] =
1655 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1656 static_cast<int>(ParenLocsOffsets::RParen)] =
1661OMPUsesAllocatorsClause::Data
1665 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1666 static_cast<int>(ExprOffsets::Allocator)];
1668 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1670 ExprOffsets::AllocatorTraits)];
1672 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1673 static_cast<int>(ParenLocsOffsets::LParen)];
1675 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1676 static_cast<int>(ParenLocsOffsets::RParen)];
1684 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1685 static_cast<int>(ExprOffsets::Total) *
Data.size(),
1686 static_cast<int>(ParenLocsOffsets::Total) *
Data.size()));
1687 auto *Clause =
new (Mem)
1688 OMPUsesAllocatorsClause(StartLoc, LParenLoc, EndLoc,
Data.size());
1689 Clause->setAllocatorsData(
Data);
1695 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1696 static_cast<int>(ExprOffsets::Total) * N,
1697 static_cast<int>(ParenLocsOffsets::Total) * N));
1698 return new (Mem) OMPUsesAllocatorsClause(N);
1706 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(Locators.size() + 1));
1707 auto *Clause =
new (Mem)
1708 OMPAffinityClause(StartLoc, LParenLoc, ColonLoc, EndLoc, Locators.size());
1709 Clause->setModifier(Modifier);
1710 Clause->setVarRefs(Locators);
1716 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1717 return new (Mem) OMPAffinityClause(N);
1727 unsigned NumPrefs = InteropInfo.
Prefs.size();
1728 unsigned NumAttrs = 0;
1730 NumAttrs += P.
Attrs.size();
1733 void *Mem =
C.Allocate(
1734 totalSizeToAlloc<Expr *, unsigned>(1 + NumPrefs + NumAttrs, NumPrefs));
1735 auto *Clause =
new (Mem)
1737 LParenLoc, VarLoc, EndLoc, 1 + NumPrefs);
1738 Clause->NumAttrs = NumAttrs;
1741 Expr **E = Clause->getTrailingObjects<
Expr *>();
1743 for (
unsigned I = 0; I < NumPrefs; ++I)
1744 E[1 + I] = InteropInfo.
Prefs[I].Fr;
1745 unsigned *AttrEnds = Clause->getTrailingObjects<
unsigned>();
1746 unsigned AttrBase = 1 + NumPrefs;
1747 unsigned AttrPos = AttrBase;
1748 for (
unsigned I = 0; I < NumPrefs; ++I) {
1749 for (
Expr *A : InteropInfo.
Prefs[I].Attrs)
1751 AttrEnds[I] = AttrPos - AttrBase;
1758 unsigned NumAttrs) {
1759 void *Mem =
C.Allocate(
1760 totalSizeToAlloc<Expr *, unsigned>(1 + NumPrefs + NumAttrs, NumPrefs));
1761 auto *Clause =
new (Mem) OMPInitClause(1 + NumPrefs);
1762 Clause->NumAttrs = NumAttrs;
1768 assert(Counts.size() == getNumPrefs() &&
1769 "attr-count vector size must match number of pref-specs");
1770 assert(Attrs.size() == NumAttrs &&
1771 "attr-expr count must match preallocated NumAttrs");
1773 unsigned *AttrEnds = getTrailingObjects<unsigned>();
1775 for (
unsigned I = 0, E = Counts.size(); I < E; ++I) {
1779 llvm::copy(Attrs, getTrailingObjects<Expr *>() + varlist_size());
1788 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops),
1789 alignof(OMPDoacrossClause));
1790 OMPDoacrossClause *Clause =
new (Mem)
1791 OMPDoacrossClause(StartLoc, LParenLoc, EndLoc, VL.size(), NumLoops);
1792 Clause->setDependenceType(DepType);
1793 Clause->setDependenceLoc(DepLoc);
1794 Clause->setColonLoc(ColonLoc);
1795 Clause->setVarRefs(VL);
1796 for (
unsigned I = 0; I < NumLoops; ++I)
1797 Clause->setLoopData(I,
nullptr);
1803 unsigned NumLoops) {
1804 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + NumLoops),
1805 alignof(OMPDoacrossClause));
1806 return new (Mem) OMPDoacrossClause(N, NumLoops);
1810 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1811 auto *It = std::next(getVarRefs().end(), NumLoop);
1816 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1817 auto *It = std::next(getVarRefs().end(), NumLoop);
1822 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1823 const auto *It = std::next(getVarRefs().end(), NumLoop);
1827OMPAbsentClause *OMPAbsentClause::Create(
const ASTContext &
C,
1832 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1833 alignof(OMPAbsentClause));
1834 auto *AC =
new (Mem) OMPAbsentClause(Loc, LLoc, RLoc, DKVec.size());
1835 AC->setDirectiveKinds(DKVec);
1839OMPAbsentClause *OMPAbsentClause::CreateEmpty(
const ASTContext &
C,
unsigned K) {
1840 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1841 alignof(OMPAbsentClause));
1842 return new (Mem) OMPAbsentClause(K);
1845OMPContainsClause *OMPContainsClause::Create(
1848 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1849 alignof(OMPContainsClause));
1850 auto *CC =
new (Mem) OMPContainsClause(Loc, LLoc, RLoc, DKVec.size());
1851 CC->setDirectiveKinds(DKVec);
1855OMPContainsClause *OMPContainsClause::CreateEmpty(
const ASTContext &
C,
1857 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1858 alignof(OMPContainsClause));
1859 return new (Mem) OMPContainsClause(K);
1868 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1869 OMPNumTeamsClause *Clause =
1870 new (Mem) OMPNumTeamsClause(
C, StartLoc, LParenLoc, EndLoc, VL.size());
1871 Clause->setVarRefs(VL);
1872 Clause->setModifier(Modifier);
1873 Clause->setModifierExpr(ModifierExpr);
1874 Clause->setModifierLoc(ModifierLoc);
1875 Clause->setPreInitStmt(PreInit, CaptureRegion);
1882 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1883 return new (Mem) OMPNumTeamsClause(N);
1892 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1893 OMPThreadLimitClause *Clause =
1894 new (Mem) OMPThreadLimitClause(
C, StartLoc, LParenLoc, EndLoc, VL.size());
1895 Clause->setVarRefs(VL);
1896 Clause->setModifier(Modifier);
1897 Clause->setModifierExpr(ModifierExpr);
1898 Clause->setModifierLoc(ModifierLoc);
1899 Clause->setPreInitStmt(PreInit, CaptureRegion);
1906 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1907 return new (Mem) OMPThreadLimitClause(N);
1917 Expr *DimsModifierExpr,
Stmt *PreInit) {
1919 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1920 OMPNumThreadsClause *Clause =
1921 new (Mem) OMPNumThreadsClause(
C, StartLoc, LParenLoc, EndLoc, VL.size());
1922 Clause->setVarRefs(VL);
1923 Clause->setPrescriptivenessModifier(PrescriptivenessModifier);
1924 Clause->setPrescriptivenessModifierLoc(PrescriptivenessModifierLoc);
1925 Clause->setDimsModifier(DimsModifier);
1926 Clause->setDimsModifierExpr(DimsModifierExpr);
1927 Clause->setDimsModifierLoc(DimsModifierLoc);
1928 Clause->setPreInitStmt(PreInit, CaptureRegion);
1935 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1936 return new (Mem) OMPNumThreadsClause(N);
1943void OMPClausePrinter::VisitOMPIfClause(
OMPIfClause *Node) {
1946 OS << getOpenMPDirectiveName(Node->
getNameModifier(), Version) <<
": ";
1951void OMPClausePrinter::VisitOMPFinalClause(
OMPFinalClause *Node) {
1959 OS <<
"num_threads";
1960 bool HasPrescriptiveness =
1963 if (HasPrescriptiveness || HasDims) {
1965 if (HasPrescriptiveness)
1968 if (HasPrescriptiveness && HasDims)
1976 VisitOMPClauseList(Node,
' ');
1978 VisitOMPClauseList(Node,
'(');
1984void OMPClausePrinter::VisitOMPAlignClause(
OMPAlignClause *Node) {
2002void OMPClausePrinter::VisitOMPSizesClause(
OMPSizesClause *Node) {
2008 Size->printPretty(OS,
nullptr, Policy, 0);
2018 llvm::interleaveComma(llvm::seq<unsigned>(Refs.size()), OS, [&](
unsigned I) {
2019 if (FillIdx && I == *FillIdx)
2022 Refs[I]->printPretty(OS, nullptr, Policy, 0);
2028 OS <<
"permutation(";
2030 E->printPretty(OS, nullptr, Policy, 0);
2035void OMPClausePrinter::VisitOMPFullClause(
OMPFullClause *Node) {
OS <<
"full"; }
2037void OMPClausePrinter::VisitOMPDepthClause(
OMPDepthClause *Node) {
2041 Depth->printPretty(OS,
nullptr, Policy, 0);
2051 Factor->printPretty(OS,
nullptr, Policy, 0);
2062 if (
First && Count) {
2064 First->printPretty(OS,
nullptr, Policy, 0);
2083void OMPClausePrinter::VisitOMPDetachClause(OMPDetachClause *Node) {
2093 if (Version >= 60 && Node->
getDefaultVC() != OMPC_DEFAULT_VC_all) {
2108void OMPClausePrinter::VisitOMPTransparentClause(OMPTransparentClause *Node) {
2109 OS <<
"transparent(";
2110 if (Node->getImpexType())
2111 Node->getImpexType()->printPretty(OS,
nullptr, Policy, 0);
2117void OMPClausePrinter::VisitOMPProcBindClause(OMPProcBindClause *Node) {
2120 unsigned(Node->getProcBindKind()))
2124void OMPClausePrinter::VisitOMPUnifiedAddressClause(OMPUnifiedAddressClause *) {
2125 OS <<
"unified_address";
2128void OMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
2129 OMPUnifiedSharedMemoryClause *) {
2130 OS <<
"unified_shared_memory";
2133void OMPClausePrinter::VisitOMPReverseOffloadClause(OMPReverseOffloadClause *) {
2134 OS <<
"reverse_offload";
2137void OMPClausePrinter::VisitOMPDynamicAllocatorsClause(
2138 OMPDynamicAllocatorsClause *) {
2139 OS <<
"dynamic_allocators";
2142void OMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
2143 OMPAtomicDefaultMemOrderClause *Node) {
2144 OS <<
"atomic_default_mem_order("
2146 Node->getAtomicDefaultMemOrderKind())
2150void OMPClausePrinter::VisitOMPSelfMapsClause(OMPSelfMapsClause *) {
2154void OMPClausePrinter::VisitOMPAtClause(OMPAtClause *Node) {
2159void OMPClausePrinter::VisitOMPSeverityClause(OMPSeverityClause *Node) {
2165void OMPClausePrinter::VisitOMPMessageClause(OMPMessageClause *Node) {
2167 if (
Expr *E = Node->getMessageString())
2168 E->printPretty(OS,
nullptr, Policy);
2172void OMPClausePrinter::VisitOMPScheduleClause(OMPScheduleClause *Node) {
2176 Node->getFirstScheduleModifier());
2180 Node->getSecondScheduleModifier());
2185 if (
auto *E = Node->getChunkSize()) {
2187 E->printPretty(OS,
nullptr, Policy);
2192void OMPClausePrinter::VisitOMPOrderedClause(OMPOrderedClause *Node) {
2194 if (
auto *
Num = Node->getNumForLoops()) {
2196 Num->printPretty(OS,
nullptr, Policy, 0);
2201void OMPClausePrinter::VisitOMPNowaitClause(OMPNowaitClause *Node) {
2203 if (
auto *Cond = Node->getCondition()) {
2205 Cond->printPretty(OS,
nullptr, Policy, 0);
2210void OMPClausePrinter::VisitOMPUntiedClause(OMPUntiedClause *) {
2214void OMPClausePrinter::VisitOMPNogroupClause(OMPNogroupClause *) {
2218void OMPClausePrinter::VisitOMPMergeableClause(OMPMergeableClause *) {
2222void OMPClausePrinter::VisitOMPReadClause(OMPReadClause *) {
OS <<
"read"; }
2224void OMPClausePrinter::VisitOMPWriteClause(OMPWriteClause *) {
OS <<
"write"; }
2226void OMPClausePrinter::VisitOMPUpdateClause(OMPUpdateClause *) {
2230void OMPClausePrinter::VisitOMPUpdateDependObjectsClause(
2231 OMPUpdateDependObjectsClause *Node) {
2234 Node->getDependencyKind());
2238void OMPClausePrinter::VisitOMPCaptureClause(OMPCaptureClause *) {
2242void OMPClausePrinter::VisitOMPCompareClause(OMPCompareClause *) {
2246void OMPClausePrinter::VisitOMPFailClause(OMPFailClause *Node) {
2251 Node->getClauseKind(),
static_cast<int>(Node->getFailParameter()));
2256void OMPClausePrinter::VisitOMPAbsentClause(OMPAbsentClause *Node) {
2259 for (
auto &D : Node->getDirectiveKinds()) {
2262 OS << getOpenMPDirectiveName(D, Version);
2268void OMPClausePrinter::VisitOMPHoldsClause(OMPHoldsClause *Node) {
2270 Node->getExpr()->printPretty(OS,
nullptr, Policy, 0);
2274void OMPClausePrinter::VisitOMPContainsClause(OMPContainsClause *Node) {
2277 for (
auto &D : Node->getDirectiveKinds()) {
2280 OS << getOpenMPDirectiveName(D, Version);
2286void OMPClausePrinter::VisitOMPNoOpenMPClause(OMPNoOpenMPClause *) {
2290void OMPClausePrinter::VisitOMPNoOpenMPRoutinesClause(
2291 OMPNoOpenMPRoutinesClause *) {
2292 OS <<
"no_openmp_routines";
2295void OMPClausePrinter::VisitOMPNoOpenMPConstructsClause(
2296 OMPNoOpenMPConstructsClause *) {
2297 OS <<
"no_openmp_constructs";
2300void OMPClausePrinter::VisitOMPNoParallelismClause(OMPNoParallelismClause *) {
2301 OS <<
"no_parallelism";
2304void OMPClausePrinter::VisitOMPSeqCstClause(OMPSeqCstClause *) {
2308void OMPClausePrinter::VisitOMPAcqRelClause(OMPAcqRelClause *) {
2312void OMPClausePrinter::VisitOMPAcquireClause(OMPAcquireClause *) {
2316void OMPClausePrinter::VisitOMPReleaseClause(OMPReleaseClause *) {
2320void OMPClausePrinter::VisitOMPRelaxedClause(OMPRelaxedClause *) {
2324void OMPClausePrinter::VisitOMPWeakClause(OMPWeakClause *) {
OS <<
"weak"; }
2326void OMPClausePrinter::VisitOMPThreadsClause(OMPThreadsClause *) {
2330void OMPClausePrinter::VisitOMPSIMDClause(OMPSIMDClause *) {
OS <<
"simd"; }
2332void OMPClausePrinter::VisitOMPDeviceClause(OMPDeviceClause *Node) {
2343void OMPClausePrinter::VisitOMPNumTeamsClause(OMPNumTeamsClause *Node) {
2344 if (!Node->varlist_empty()) {
2353 VisitOMPClauseList(Node,
':');
2355 VisitOMPClauseList(Node,
'(');
2361void OMPClausePrinter::VisitOMPThreadLimitClause(OMPThreadLimitClause *Node) {
2362 if (!Node->varlist_empty()) {
2363 OS <<
"thread_limit";
2364 if (Node->
getModifier() == OMPC_THREADLIMIT_dims) {
2368 VisitOMPClauseList(Node,
':');
2370 VisitOMPClauseList(Node,
'(');
2376void OMPClausePrinter::VisitOMPPriorityClause(OMPPriorityClause *Node) {
2382void OMPClausePrinter::VisitOMPGrainsizeClause(OMPGrainsizeClause *Node) {
2393void OMPClausePrinter::VisitOMPNumTasksClause(OMPNumTasksClause *Node) {
2404void OMPClausePrinter::VisitOMPHintClause(OMPHintClause *Node) {
2410void OMPClausePrinter::VisitOMPInitClause(OMPInitClause *Node) {
2412 if (!Node->
prefs().empty()) {
2413 OS <<
"prefer_type(";
2416 llvm::interleaveComma(Node->
prefs(), OS, [&](OMPInitClause::PrefView P) {
2420 P.Fr->printPretty(OS, nullptr, Policy);
2422 if (!P.Attrs.empty())
2427 llvm::interleaveComma(P.Attrs, OS, [&](const Expr *A) {
2428 A->printPretty(OS, nullptr, Policy);
2437 [&](OMPInitClause::PrefView P) {
2439 P.Fr->printPretty(OS, nullptr, Policy);
2457void OMPClausePrinter::VisitOMPUseClause(OMPUseClause *Node) {
2463void OMPClausePrinter::VisitOMPDestroyClause(OMPDestroyClause *Node) {
2467 E->printPretty(OS,
nullptr, Policy);
2472void OMPClausePrinter::VisitOMPNovariantsClause(OMPNovariantsClause *Node) {
2476 E->printPretty(OS,
nullptr, Policy, 0);
2481void OMPClausePrinter::VisitOMPNocontextClause(OMPNocontextClause *Node) {
2485 E->printPretty(OS,
nullptr, Policy, 0);
2491void OMPClausePrinter::VisitOMPClauseList(
T *Node,
char StartSym) {
2492 for (
typename T::varlist_iterator I = Node->varlist_begin(),
2493 E = Node->varlist_end();
2495 assert(*I &&
"Expected non-null Stmt");
2496 OS << (I == Node->varlist_begin() ? StartSym :
',');
2497 if (
auto *DRE = dyn_cast<DeclRefExpr>(*I)) {
2499 DRE->printPretty(OS,
nullptr, Policy, 0);
2501 DRE->getDecl()->printQualifiedName(OS);
2503 (*I)->printPretty(OS,
nullptr, Policy, 0);
2511 Expr *FirstModifier =
nullptr;
2512 Expr *SecondModifier =
nullptr;
2517 if (FirstAllocMod == OMPC_ALLOCATE_allocator ||
2528 if (FirstModifier) {
2530 if (!FirstUnknown) {
2534 FirstModifier->
printPretty(OS,
nullptr, Policy, 0);
2537 if (SecondModifier) {
2539 if (!SecondUnknown) {
2544 SecondModifier->
printPretty(OS,
nullptr, Policy, 0);
2549 VisitOMPClauseList(Node,
' ');
2552 VisitOMPClauseList(Node,
'(');
2557void OMPClausePrinter::VisitOMPPrivateClause(OMPPrivateClause *Node) {
2558 if (!Node->varlist_empty()) {
2560 VisitOMPClauseList(Node,
'(');
2565void OMPClausePrinter::VisitOMPFirstprivateClause(OMPFirstprivateClause *Node) {
2566 if (!Node->varlist_empty()) {
2567 OS <<
"firstprivate";
2568 VisitOMPClauseList(Node,
'(');
2573void OMPClausePrinter::VisitOMPLastprivateClause(OMPLastprivateClause *Node) {
2574 if (!Node->varlist_empty()) {
2575 OS <<
"lastprivate";
2587void OMPClausePrinter::VisitOMPSharedClause(OMPSharedClause *Node) {
2588 if (!Node->varlist_empty()) {
2590 VisitOMPClauseList(Node,
'(');
2595void OMPClausePrinter::VisitOMPReductionClause(OMPReductionClause *Node) {
2596 if (!Node->varlist_empty()) {
2598 if (Node->getModifierLoc().isValid())
2602 Node->getQualifierLoc().getNestedNameSpecifier();
2604 Node->getNameInfo().getName().getCXXOverloadedOperator();
2605 if (!Qualifier && OOK !=
OO_None) {
2611 OS << Node->getNameInfo();
2614 VisitOMPClauseList(Node,
' ');
2619void OMPClausePrinter::VisitOMPTaskReductionClause(
2620 OMPTaskReductionClause *Node) {
2621 if (!Node->varlist_empty()) {
2622 OS <<
"task_reduction(";
2624 Node->getQualifierLoc().getNestedNameSpecifier();
2626 Node->getNameInfo().getName().getCXXOverloadedOperator();
2627 if (!Qualifier && OOK !=
OO_None) {
2633 OS << Node->getNameInfo();
2636 VisitOMPClauseList(Node,
' ');
2641void OMPClausePrinter::VisitOMPInReductionClause(OMPInReductionClause *Node) {
2642 if (!Node->varlist_empty()) {
2643 OS <<
"in_reduction(";
2645 Node->getQualifierLoc().getNestedNameSpecifier();
2647 Node->getNameInfo().getName().getCXXOverloadedOperator();
2648 if (!Qualifier && OOK !=
OO_None) {
2654 OS << Node->getNameInfo();
2657 VisitOMPClauseList(Node,
' ');
2662void OMPClausePrinter::VisitOMPLinearClause(OMPLinearClause *Node) {
2663 if (!Node->varlist_empty()) {
2665 VisitOMPClauseList(Node,
'(');
2666 if (Node->getModifierLoc().isValid() || Node->getStep() !=
nullptr) {
2669 if (Node->getModifierLoc().isValid()) {
2672 if (Node->getStep() !=
nullptr) {
2673 if (Node->getModifierLoc().isValid()) {
2677 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
2684void OMPClausePrinter::VisitOMPAlignedClause(OMPAlignedClause *Node) {
2685 if (!Node->varlist_empty()) {
2687 VisitOMPClauseList(Node,
'(');
2696void OMPClausePrinter::VisitOMPCopyinClause(OMPCopyinClause *Node) {
2697 if (!Node->varlist_empty()) {
2699 VisitOMPClauseList(Node,
'(');
2704void OMPClausePrinter::VisitOMPCopyprivateClause(OMPCopyprivateClause *Node) {
2705 if (!Node->varlist_empty()) {
2706 OS <<
"copyprivate";
2707 VisitOMPClauseList(Node,
'(');
2712void OMPClausePrinter::VisitOMPFlushClause(OMPFlushClause *Node) {
2713 if (!Node->varlist_empty()) {
2714 VisitOMPClauseList(Node,
'(');
2719void OMPClausePrinter::VisitOMPDepobjClause(OMPDepobjClause *Node) {
2725void OMPClausePrinter::VisitOMPDependClause(OMPDependClause *Node) {
2733 bool IsOmpAllMemory =
false;
2734 if (PrintKind == OMPC_DEPEND_outallmemory) {
2735 PrintKind = OMPC_DEPEND_out;
2736 IsOmpAllMemory =
true;
2737 }
else if (PrintKind == OMPC_DEPEND_inoutallmemory) {
2738 PrintKind = OMPC_DEPEND_inout;
2739 IsOmpAllMemory =
true;
2742 if (!Node->varlist_empty() || IsOmpAllMemory)
2744 VisitOMPClauseList(Node,
' ');
2745 if (IsOmpAllMemory) {
2746 OS << (Node->varlist_empty() ?
" " :
",");
2747 OS <<
"omp_all_memory";
2752template <
typename T>
2757 Node->getMapperQualifierLoc().getNestedNameSpecifier();
2758 MapperNNS.
print(OS, Policy);
2759 OS << Node->getMapperIdInfo() <<
')';
2762template <
typename T>
2765 if (
Expr *IteratorModifier = Node->getIteratorModifier())
2766 IteratorModifier->printPretty(OS,
nullptr, Policy);
2769void OMPClausePrinter::VisitOMPMapClause(OMPMapClause *Node) {
2770 if (!Node->varlist_empty()) {
2789 VisitOMPClauseList(Node,
' ');
2794template <
typename T>
void OMPClausePrinter::VisitOMPMotionClause(
T *Node) {
2795 if (Node->varlist_empty())
2797 OS << getOpenMPClauseName(Node->getClauseKind());
2798 unsigned ModifierCount = 0;
2803 if (ModifierCount) {
2807 if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_iterator) {
2811 Node->getMotionModifier(I));
2812 if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2814 if (I < ModifierCount - 1)
2820 VisitOMPClauseList(Node,
' ');
2822 VisitOMPClauseList(Node,
'(');
2827void OMPClausePrinter::VisitOMPToClause(OMPToClause *Node) {
2828 VisitOMPMotionClause(Node);
2831void OMPClausePrinter::VisitOMPFromClause(OMPFromClause *Node) {
2832 VisitOMPMotionClause(Node);
2835void OMPClausePrinter::VisitOMPDistScheduleClause(OMPDistScheduleClause *Node) {
2840 E->printPretty(OS,
nullptr, Policy);
2845void OMPClausePrinter::VisitOMPDefaultmapClause(OMPDefaultmapClause *Node) {
2846 OS <<
"defaultmap(";
2857void OMPClausePrinter::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *Node) {
2858 if (!Node->varlist_empty()) {
2859 OS <<
"use_device_ptr";
2865 VisitOMPClauseList(Node,
' ');
2867 VisitOMPClauseList(Node,
'(');
2873void OMPClausePrinter::VisitOMPUseDeviceAddrClause(
2874 OMPUseDeviceAddrClause *Node) {
2875 if (!Node->varlist_empty()) {
2876 OS <<
"use_device_addr";
2877 VisitOMPClauseList(Node,
'(');
2882void OMPClausePrinter::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *Node) {
2883 if (!Node->varlist_empty()) {
2884 OS <<
"is_device_ptr";
2885 VisitOMPClauseList(Node,
'(');
2890void OMPClausePrinter::VisitOMPHasDeviceAddrClause(OMPHasDeviceAddrClause *Node) {
2891 if (!Node->varlist_empty()) {
2892 OS <<
"has_device_addr";
2893 VisitOMPClauseList(Node,
'(');
2898void OMPClausePrinter::VisitOMPNontemporalClause(OMPNontemporalClause *Node) {
2899 if (!Node->varlist_empty()) {
2900 OS <<
"nontemporal";
2901 VisitOMPClauseList(Node,
'(');
2906void OMPClausePrinter::VisitOMPOrderClause(OMPOrderClause *Node) {
2915void OMPClausePrinter::VisitOMPInclusiveClause(OMPInclusiveClause *Node) {
2916 if (!Node->varlist_empty()) {
2918 VisitOMPClauseList(Node,
'(');
2923void OMPClausePrinter::VisitOMPExclusiveClause(OMPExclusiveClause *Node) {
2924 if (!Node->varlist_empty()) {
2926 VisitOMPClauseList(Node,
'(');
2931void OMPClausePrinter::VisitOMPUsesAllocatorsClause(
2932 OMPUsesAllocatorsClause *Node) {
2935 OS <<
"uses_allocators(";
2938 Data.Allocator->printPretty(OS,
nullptr, Policy);
2939 if (
Data.AllocatorTraits) {
2941 Data.AllocatorTraits->printPretty(OS,
nullptr, Policy);
2950void OMPClausePrinter::VisitOMPAffinityClause(OMPAffinityClause *Node) {
2951 if (Node->varlist_empty())
2954 char StartSym =
'(';
2957 Modifier->printPretty(OS,
nullptr, Policy);
2961 VisitOMPClauseList(Node, StartSym);
2965void OMPClausePrinter::VisitOMPFilterClause(OMPFilterClause *Node) {
2971void OMPClausePrinter::VisitOMPBindClause(OMPBindClause *Node) {
2977void OMPClausePrinter::VisitOMPXDynCGroupMemClause(
2978 OMPXDynCGroupMemClause *Node) {
2979 OS <<
"ompx_dyn_cgroup_mem(";
2984void OMPClausePrinter::VisitOMPDynGroupprivateClause(
2985 OMPDynGroupprivateClause *Node) {
2986 OS <<
"dyn_groupprivate(";
3002void OMPClausePrinter::VisitOMPDoacrossClause(OMPDoacrossClause *Node) {
3007 case OMPC_DOACROSS_source:
3010 case OMPC_DOACROSS_sink:
3013 case OMPC_DOACROSS_source_omp_cur_iteration:
3014 OS <<
"source: omp_cur_iteration";
3016 case OMPC_DOACROSS_sink_omp_cur_iteration:
3017 OS <<
"sink: omp_cur_iteration - 1";
3020 llvm_unreachable(
"unknown docaross modifier");
3022 VisitOMPClauseList(Node,
' ');
3026void OMPClausePrinter::VisitOMPXAttributeClause(OMPXAttributeClause *Node) {
3027 OS <<
"ompx_attribute(";
3038void OMPClausePrinter::VisitOMPXBareClause(OMPXBareClause *Node) {
3043 VariantMatchInfo &VMI)
const {
3048 if (
Selector.Kind == TraitSelector::user_condition) {
3049 assert(
Selector.ScoreOrCondition &&
3050 "Ill-formed user condition, expected condition expression!");
3051 assert(
Selector.Properties.size() == 1 &&
3052 Selector.Properties.front().Kind ==
3053 TraitProperty::user_condition_unknown &&
3054 "Ill-formed user condition, expected unknown trait property!");
3056 if (std::optional<APSInt> CondVal =
3057 Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx))
3058 VMI.addTrait(CondVal->isZero() ? TraitProperty::user_condition_false
3059 : TraitProperty::user_condition_true,
3062 VMI.addTrait(TraitProperty::user_condition_false,
"<condition>");
3066 std::optional<llvm::APSInt> Score;
3067 llvm::APInt *ScorePtr =
nullptr;
3069 if ((Score =
Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx)))
3072 VMI.addTrait(TraitProperty::user_condition_false,
3073 "<non-constant-score>");
3077 VMI.addTrait(
Set.Kind, Property.Kind, Property.RawString, ScorePtr);
3079 if (
Set.Kind != TraitSet::construct)
3083 assert(
Selector.Properties.size() == 1 &&
3084 Selector.Properties.front().Kind ==
3085 getOpenMPContextTraitPropertyForSelector(
3087 "Ill-formed construct selector!");
3094 bool FirstSet =
true;
3099 OS << getOpenMPContextTraitSetName(
Set.Kind) <<
"={";
3101 bool FirstSelector =
true;
3105 FirstSelector =
false;
3106 OS << getOpenMPContextTraitSelectorName(
Selector.Kind);
3108 bool AllowsTraitScore =
false;
3109 bool RequiresProperty =
false;
3110 isValidTraitSelectorForTraitSet(
3111 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
3113 if (!RequiresProperty)
3117 if (
Selector.Kind == TraitSelector::user_condition) {
3119 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
3126 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
3130 bool FirstProperty =
true;
3134 FirstProperty =
false;
3135 OS << getOpenMPContextTraitPropertyName(Property.Kind,
3136 Property.RawString);
3146 std::string MangledName;
3147 llvm::raw_string_ostream OS(MangledName);
3152 bool AllowsTraitScore =
false;
3153 bool RequiresProperty =
false;
3154 isValidTraitSelectorForTraitSet(
3155 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
3158 if (!RequiresProperty ||
3159 Selector.Kind == TraitSelector::user_condition)
3164 << getOpenMPContextTraitPropertyName(Property.Kind,
3165 Property.RawString);
3171OMPTraitInfo::OMPTraitInfo(StringRef MangledName) {
3174 if (!MangledName.consume_front(
"$S"))
3176 if (MangledName.consumeInteger(10,
U))
3180 Set.Kind = TraitSet(
U);
3182 if (!MangledName.consume_front(
"$s"))
3184 if (MangledName.consumeInteger(10,
U))
3190 if (!MangledName.consume_front(
"$P"))
3194 std::pair<StringRef, StringRef> PropRestPair = MangledName.split(
'$');
3195 Property.RawString = PropRestPair.first;
3196 Property.Kind = getOpenMPContextTraitPropertyKind(
3198 MangledName = MangledName.drop_front(PropRestPair.first.size());
3208 TI.
print(OS, Policy);
3213 return TI ? OS << *TI : OS;
3220 : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
3222 ASTCtx.getLangOpts().OMPTargetTriples.empty()
3224 : ASTCtx.getLangOpts().OMPTargetTriples[0],
3226 FeatureValidityCheck([&](StringRef FeatureName) {
3227 return ASTCtx.
getTargetInfo().isValidFeatureName(FeatureName);
3229 DiagUnknownTrait(std::move(DiagUnknownTrait)) {
3232 for (llvm::omp::TraitProperty Property : ConstructTraits)
3237 auto It = FeatureMap.find(RawString);
3238 if (It != FeatureMap.end())
3240 if (!FeatureValidityCheck(RawString))
3241 DiagUnknownTrait(RawString);
Defines the clang::ASTContext interface.
This file defines OpenMP nodes for declarative directives.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static StringRef getTriple(const Command &Job)
static Stmt ** getAddrOfExprAsWritten(Stmt *S)
Gets the address of the original, non-captured, expression used in the clause as the preinitializer.
static void PrintIterator(raw_ostream &OS, T *Node, const PrintingPolicy &Policy)
static void PrintMapper(raw_ostream &OS, T *Node, const PrintingPolicy &Policy)
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
This represents clause 'affinity' in the 'pragma omp task'-based directives.
static OMPAffinityClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Creates clause with a modifier a list of locator items.
Expr * getModifier()
Gets affinity modifier.
static OMPAffinityClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N locator items.
static OMPAlignedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, Expr *A)
Creates clause with a list of variables VL and alignment A.
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
Expr * getAlignment()
Returns alignment.
OpenMPBindClauseKind getBindKind() const
Returns kind of the clause.
Class that represents a component of a mappable expression. E.g. for an expression S....
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< const ValueDecl * > Declarations)
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
static std::pair< const Expr *, std::optional< size_t > > findAttachPtrExpr(MappableExprComponentListRef Components, OpenMPDirectiveKind CurDirKind)
Find the attach pointer expression from a list of mappable expression components.
static QualType getComponentExprElementType(const Expr *Exp)
Get the type of an element of a ComponentList Expr Exp.
ArrayRef< MappableComponent > MappableExprComponentListRef
static OMPCopyinClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPCopyprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
static OMPDependClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, DependDataTy Data, Expr *DepModifier, ArrayRef< Expr * > VL, unsigned NumLoops)
Creates clause with a list of variables VL.
Expr * getModifier()
Return optional depend modifier.
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data for the depend clauses with 'sink|source' kind of dependency.
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N variables.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
Expr * getDepobj()
Returns depobj expression associated with the clause.
Expr * getInteropVar() const
Returns the interop variable.
Expr * getEventHandler() const
Returns event-handler expression.
This represents 'device' clause in the 'pragma omp ...' directive.
OpenMPDeviceClauseModifier getModifier() const
Gets modifier.
Expr * getDevice()
Return device number.
This represents 'dist_schedule' clause in the 'pragma omp ...' directive.
Expr * getChunkSize()
Get chunk size.
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data.
OpenMPDoacrossClauseModifier getDependenceType() const
Get dependence type.
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
static OMPDoacrossClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VL, unsigned NumLoops)
Creates clause with a list of expressions VL.
static OMPDoacrossClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N expressions.
This represents 'dyn_groupprivate' clause in 'pragma omp target ...' and 'pragma omp teams ....
Expr * getSize()
Get size.
OpenMPDynGroupprivateClauseFallbackModifier getDynGroupprivateFallbackModifier() const
Get the second modifier of the clause.
OpenMPDynGroupprivateClauseModifier getDynGroupprivateModifier() const
Get the first modifier of the clause.
static OMPExclusiveClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static OMPExclusiveClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
This represents 'filter' clause in the 'pragma omp ...' directive.
Expr * getThreadID() const
Return thread identifier.
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPFlushClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
This represents clause 'from' in the 'pragma omp ...' directives.
static OMPFromClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr * > UDMapperRefs, Expr *IteratorExpr, ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
static OMPFromClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents 'grainsize' clause in the 'pragma omp ...' directive.
OpenMPGrainsizeClauseModifier getModifier() const
Gets modifier.
Expr * getGrainsize() const
Return safe iteration space distance.
child_range used_children()
This represents clause 'has_device_ptr' in the 'pragma omp ...' directives.
static OMPHasDeviceAddrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPHasDeviceAddrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
Expr * getHint() const
Returns number of threads.
static OMPInclusiveClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
static OMPInclusiveClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
bool getIsTarget() const
Returns true is interop-type 'target' is used.
static OMPInitClause * CreateEmpty(const ASTContext &C, unsigned NumPrefs, unsigned NumAttrs)
Creates an empty clause sized for NumPrefs pref-specs and NumAttrs total attr() exprs across them.
bool hasPreferAttrs() const
Returns true if OMP 6.0 {fr/attr} syntax is used.
Expr * getInteropVar()
Returns the interop variable.
static OMPInitClause * Create(const ASTContext &C, Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Creates a fully specified clause.
bool getIsTargetSync() const
Returns true is interop-type 'targetsync' is used.
auto prefs() const
Returns a range of PrefView objects, one per preference-specification, each carrying the fr() express...
This represents clause 'is_device_ptr' in the 'pragma omp ...' directives.
static OMPIsDevicePtrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents clause 'map' in the 'pragma omp ...' directives.
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
OpenMPMapModifierKind getMapTypeModifier(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier at 'Cnt' index of array of modifiers.
static OMPMapClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr * > UDMapperRefs, Expr *IteratorModifier, ArrayRef< OpenMPMapModifierKind > MapModifiers, ArrayRef< SourceLocation > MapModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
Creates clause with a list of variables VL.
static OMPMapClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
This represents 'nocontext' clause in the 'pragma omp ...' directive.
Expr * getCondition() const
Returns condition.
child_range used_children()
static OMPNontemporalClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static OMPNontemporalClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
void setPrivateRefs(ArrayRef< Expr * > VL)
Sets the list of references to private copies created in private clauses.
This represents 'novariants' clause in the 'pragma omp ...' directive.
Expr * getCondition() const
Returns condition.
child_range used_children()
This represents 'num_tasks' clause in the 'pragma omp ...' directive.
OpenMPNumTasksClauseModifier getModifier() const
Gets modifier.
child_range used_children()
Expr * getNumTasks() const
Return safe iteration space distance.
This represents 'num_teams' clause in the 'pragma omp ...' directive.
OpenMPNumTeamsClauseModifier getModifier() const
Get the modifier.
static OMPNumTeamsClause * Create(const ASTContext &C, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, OpenMPNumTeamsClauseModifier Modifier, Expr *ModifierExpr, SourceLocation ModifierLoc, Stmt *PreInit)
Creates clause with a list of variables VL.
const Expr * getModifierExpr() const
Get the expression of the modifier.
static OMPNumTeamsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
OpenMPOrderClauseKind getKind() const
Returns kind of the clause.
OpenMPOrderClauseModifier getModifier() const
Returns Modifier of the clause.
This represents 'priority' clause in the 'pragma omp ...' directive.
child_range used_children()
Expr * getPriority()
Return Priority number.
This represents 'thread_limit' clause in the 'pragma omp ...' directive.
static OMPThreadLimitClause * Create(const ASTContext &C, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, OpenMPThreadLimitClauseModifier Modifier, Expr *ModifierExpr, SourceLocation ModifierLoc, Stmt *PreInit)
Creates clause with a list of variables VL.
const Expr * getModifierExpr() const
Get the expression of the modifier.
OpenMPThreadLimitClauseModifier getModifier() const
Get the modifier.
static OMPThreadLimitClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPToClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
static OMPToClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr * > UDMapperRefs, Expr *IteratorModifier, ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
std::string getMangledName() const
Return a string representation identifying this context selector.
void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const
Print a human readable representation into OS.
void getAsVariantMatchInfo(ASTContext &ASTCtx, llvm::omp::VariantMatchInfo &VMI) const
Create a variant match info object from this trait info object.
llvm::SmallVector< OMPTraitSet, 2 > Sets
The outermost level of selector sets.
Expr * getInteropVar() const
Returns the interop variable.
This represents clause 'use_device_addr' in the 'pragma omp ...' directives.
static OMPUseDeviceAddrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPUseDeviceAddrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents clause 'use_device_ptr' in the 'pragma omp ...' directives.
static OMPUseDevicePtrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< Expr * > PrivateVars, ArrayRef< Expr * > Inits, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, OpenMPUseDevicePtrFallbackModifier FallbackModifier, SourceLocation FallbackModifierLoc)
Creates clause with a list of variables Vars.
OpenMPUseDevicePtrFallbackModifier getFallbackModifier() const
Get the fallback modifier for the clause.
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents clause 'uses_allocators' in the 'pragma omp target'-based directives.
OMPUsesAllocatorsClause::Data getAllocatorData(unsigned I) const
Returns data for the specified allocator.
static OMPUsesAllocatorsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N allocators.
static OMPUsesAllocatorsClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< OMPUsesAllocatorsClause::Data > Data)
Creates clause with a list of allocators Data.
unsigned getNumberOfAllocators() const
Returns number of allocators associated with the clause.
ArrayRef< const Attr * > getAttrs() const
Returned the attributes parsed from this clause.
This represents 'ompx_dyn_cgroup_mem' clause in the 'pragma omp target ...' directive.
Expr * getSize()
Return the size expression.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const TargetInfo & getTargetInfo() const
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
static QualType getBaseOriginalType(const Expr *Base)
Return original type of the base expression for array section.
Attr - This represents one attribute.
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const
This represents one expression.
Represents a function declaration or definition.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false, bool PrintFinalScopeResOp=true) const
Print this nested name specifier to the given output stream.
This represents the 'align' clause in the 'pragma omp allocate' directive.
Expr * getAlignment() const
Returns alignment.
This represents clause 'allocate' in the 'pragma omp ...' directives.
static OMPAllocateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, Expr *Allocator, Expr *Alignment, SourceLocation ColonLoc, OpenMPAllocateClauseModifier Modifier1, SourceLocation Modifier1Loc, OpenMPAllocateClauseModifier Modifier2, SourceLocation Modifier2Loc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
OpenMPAllocateClauseModifier getSecondAllocateModifier() const
Get the second modifier of the clause.
Expr * getAlignment() const
Returns the alignment expression or nullptr, if no alignment specified.
OpenMPAllocateClauseModifier getFirstAllocateModifier() const
Get the first modifier of the clause.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
static OMPAllocateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'allocator' clause in the 'pragma omp ...' directive.
Expr * getAllocator() const
Returns allocator.
static OMPClauseWithPostUpdate * get(OMPClause *C)
OMPClauseWithPostUpdate(const OMPClause *This)
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
OMPClauseWithPreInit(const OMPClause *This)
static OMPClauseWithPreInit * get(OMPClause *C)
This is a basic class for representing single OpenMP clause.
child_range used_children()
Get the iterator range for the expressions used in the clauses.
llvm::iterator_range< child_iterator > child_range
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
This represents 'collapse' clause in the 'pragma omp ...' directive.
Expr * getNumForLoops() const
Return the number of associated for-loops.
This represents the 'counts' clause in the 'pragma omp split' directive.
std::optional< unsigned > getOmpFillIndex() const
static OMPCountsClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Counts, std::optional< unsigned > FillIdx, SourceLocation FillLoc)
Build a 'counts' AST node.
static OMPCountsClause * CreateEmpty(const ASTContext &C, unsigned NumCounts)
Build an empty 'counts' AST node for deserialization.
MutableArrayRef< Expr * > getCountsRefs()
Returns the count expressions.
This represents 'default' clause in the 'pragma omp ...' directive.
llvm::omp::DefaultKind getDefaultKind() const
Returns kind of the clause.
OpenMPDefaultClauseVariableCategory getDefaultVC() const
This represents the 'depth' clause on the 'pragma omp flatten' (and 'pragma omp fuse') loop-transform...
Expr * getDepth() const
Returns the depth expression or nullptr if not set.
This represents 'final' clause in the 'pragma omp ...' directive.
child_range used_children()
Expr * getCondition() const
Returns condition.
Representation of the 'full' clause of the 'pragma omp unroll' directive.
This represents 'if' clause in the 'pragma omp ...' directive.
child_range used_children()
Expr * getCondition() const
Returns condition.
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
This class represents the 'looprange' clause in the 'pragma omp fuse' directive.
Expr * getFirst() const
Get looprange 'first' expression.
Expr * getCount() const
Get looprange 'count' expression.
This represents 'num_threads' clause in the 'pragma omp ...' directive.
Expr * getDimsModifierExpr()
Returns the dims modifier expression if present.
OpenMPNumThreadsClauseModifier getDimsModifier() const
Returns the dims modifier.
OpenMPNumThreadsClauseModifier getPrescriptivenessModifier() const
Returns the prescriptiveness modifier.
static OMPNumThreadsClause * Create(const ASTContext &C, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, OpenMPNumThreadsClauseModifier PrescriptivenessModifier, OpenMPNumThreadsClauseModifier DimsModifier, SourceLocation PrescriptivenessModifierLoc, SourceLocation DimsModifierLoc, Expr *DimsModifierExpr, Stmt *PreInit)
Creates clause with a list of variables/expressions.
static OMPNumThreadsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N expressions.
llvm::iterator_range< child_iterator > child_range
Representation of the 'partial' clause of the 'pragma omp unroll' directive.
Expr * getFactor() const
Returns the argument of the clause or nullptr if not set.
This class represents the 'permutation' clause in the 'pragma omp interchange' directive.
MutableArrayRef< Expr * > getArgsRefs()
Returns the permutation index expressions.
static OMPPermutationClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'permutation' AST node for deserialization.
static OMPPermutationClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Args)
Build a 'permutation' clause AST node.
This represents 'safelen' clause in the 'pragma omp ...' directive.
Expr * getSafelen() const
Return safe iteration space distance.
This represents 'simdlen' clause in the 'pragma omp ...' directive.
Expr * getSimdlen() const
Return safe iteration space distance.
This represents the 'sizes' clause in the 'pragma omp tile' directive.
static OMPSizesClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Sizes)
Build a 'sizes' AST node.
MutableArrayRef< Expr * > getSizesRefs()
Returns the tile size expressions.
static OMPSizesClause * CreateEmpty(const ASTContext &C, unsigned NumSizes)
Build an empty 'sizes' AST node for deserialization.
This represents 'threadset' clause in the 'pragma omp task ...' directive.
OpenMPThreadsetKind getThreadsetKind() const
Returns kind of the clause.
bool varlist_empty() const
A (possibly-)qualified type.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
QualType getCanonicalType() const
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
Stmt - This represents one statement.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
Base wrapper for a particular "section" of type source info.
The base class of the type hierarchy.
bool isPointerType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Defines the clang::TargetInfo interface.
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
Top level wrappers for InstallAPI frontend operations.
OpenMPOriginalSharingModifier
OpenMP 6.0 original sharing modifiers.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
Privates[]
This class represents the 'transparent' clause in the 'pragma omp task' directive.
bool isa(CodeGen::Address addr)
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ OMPC_ORDER_MODIFIER_unknown
MutableArrayRef< Expr * > getPrivates()
Finals[]; Step; CalcStep; }.
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
@ OMPC_SCHEDULE_MODIFIER_unknown
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
OpenMPNumTeamsClauseModifier
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
static constexpr unsigned NumberOfOMPMapClauseModifiers
Number of allowed map-type-modifiers.
@ OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown
const FunctionProtoType * T
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
@ OMPC_LASTPRIVATE_unknown
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
OpenMPUseDevicePtrFallbackModifier
OpenMP 6.1 use_device_ptr fallback modifier.
@ OMPC_USE_DEVICE_PTR_FALLBACK_unknown
MutableArrayRef< Expr * > getUsedExprs()
Gets the list of used expressions for linear variables.
static constexpr unsigned NumberOfOMPMotionModifiers
Number of allowed motion-modifiers.
@ OMPC_MOTION_MODIFIER_unknown
@ OMPC_DEFAULTMAP_unknown
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
@ OMPC_DYN_GROUPPRIVATE_unknown
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
OpenMPThreadLimitClauseModifier
MutableArrayRef< Expr * > getInits()
OpenMPNumThreadsClauseModifier
@ OMPC_NUMTHREADS_unknown
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
U cast(CodeGen::Address addr)
const char * getOpenMPDefaultVariableCategoryName(unsigned VC)
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
@ OMPC_MAP_MODIFIER_unknown
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Diagnostic wrappers for TextAPI types for error reporting.
int const char * function
ArrayRef< Expr * > Attrs
attr() string-literal expressions. Empty for fr-only or OMP 5.1 flat specs.
This structure contains all sizes needed for by an OMPMappableExprListClause.
unsigned NumComponents
Total number of expression components.
unsigned NumUniqueDeclarations
Number of unique base declarations.
unsigned NumVars
Number of expressions listed.
unsigned NumComponentLists
Number of component lists.
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
TargetOMPContext(ASTContext &ASTCtx, std::function< void(StringRef)> &&DiagUnknownTrait, const FunctionDecl *CurrentFunctionDecl, ArrayRef< llvm::omp::TraitProperty > ConstructTraits, int DeviceNum)
bool matchesISATrait(StringRef RawString) const override
See llvm::omp::OMPContext::matchesISATrait.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
llvm::SmallVector< OMPInteropPref, 4 > Prefs
One entry of a prefer_type list.
llvm::SmallVector< Expr *, 2 > Attrs
This structure contains most locations needed for by an OMPVarListClause.
Describes how types, statements, expressions, and declarations should be printed.