21#include "llvm/ADT/SmallPtrSet.h"
22#include "llvm/Support/Casting.h"
23#include "llvm/Support/ErrorHandling.h"
36#define GEN_CLANG_CLAUSE_CLASS
37#define CLAUSE_CLASS(Enum, Str, Class) \
39 return static_cast<Class *>(this)->children();
40#include "llvm/Frontend/OpenMP/OMP.inc"
42 llvm_unreachable(
"unknown OMPClause");
47#define GEN_CLANG_CLAUSE_CLASS
48#define CLAUSE_CLASS(Enum, Str, Class) \
50 return static_cast<Class *>(this)->used_children();
51#define CLAUSE_NO_CLASS(Enum, Str) \
54#include "llvm/Frontend/OpenMP/OMP.inc"
56 llvm_unreachable(
"unknown OMPClause");
65 switch (
C->getClauseKind()) {
68 case OMPC_dist_schedule:
70 case OMPC_firstprivate:
72 case OMPC_lastprivate:
76 case OMPC_task_reduction:
78 case OMPC_in_reduction:
84 case OMPC_num_threads:
88 case OMPC_thread_limit:
100 case OMPC_novariants:
106 case OMPC_ompx_dyn_cgroup_mem:
120 case OMPC_copyprivate:
125 case OMPC_threadprivate:
145 case OMPC_defaultmap:
150 case OMPC_use_device_ptr:
151 case OMPC_use_device_addr:
152 case OMPC_is_device_ptr:
153 case OMPC_has_device_addr:
154 case OMPC_unified_address:
155 case OMPC_unified_shared_memory:
156 case OMPC_reverse_offload:
157 case OMPC_dynamic_allocators:
158 case OMPC_atomic_default_mem_order:
162 case OMPC_device_type:
164 case OMPC_nontemporal:
170 case OMPC_uses_allocators:
189 switch (
C->getClauseKind()) {
190 case OMPC_lastprivate:
194 case OMPC_task_reduction:
196 case OMPC_in_reduction:
201 case OMPC_dist_schedule:
202 case OMPC_firstprivate:
207 case OMPC_num_threads:
218 case OMPC_copyprivate:
223 case OMPC_threadprivate:
243 case OMPC_thread_limit:
249 case OMPC_defaultmap:
254 case OMPC_use_device_ptr:
255 case OMPC_use_device_addr:
256 case OMPC_is_device_ptr:
257 case OMPC_has_device_addr:
258 case OMPC_unified_address:
259 case OMPC_unified_shared_memory:
260 case OMPC_reverse_offload:
261 case OMPC_dynamic_allocators:
262 case OMPC_atomic_default_mem_order:
266 case OMPC_device_type:
268 case OMPC_nontemporal:
271 case OMPC_novariants:
276 case OMPC_uses_allocators:
293 if (
auto *DS = dyn_cast<DeclStmt>(S)) {
294 assert(DS->isSingleDecl() &&
"Only single expression must be captured.");
295 if (
auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
296 return OED->getInitAddress();
348 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
351 for (
unsigned I = 0; I < NumLoops; ++I) {
353 Clause->setLoopCounter(I,
nullptr);
360 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
362 for (
unsigned I = 0; I < NumLoops; ++I) {
364 Clause->setLoopCounter(I,
nullptr);
370 Expr *NumIterations) {
371 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
372 getTrailingObjects<Expr *>()[NumLoop] = NumIterations;
376 return llvm::ArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
380 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
381 getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop] = Counter;
385 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
386 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
390 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
391 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
405 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
409 Clause->setLParenLoc(LParenLoc);
410 Clause->setArgumentLoc(ArgumentLoc);
411 Clause->setDependencyKind(DK);
420 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
423 Clause->IsExtended =
true;
429 "Number of private copies is not the same as the preallocated buffer");
438 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
442 Clause->setPrivateCopies(PrivateVL);
448 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
454 "Number of private copies is not the same as the preallocated buffer");
460 "Number of inits is not the same as the preallocated buffer");
461 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
469 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
473 Clause->setPrivateCopies(PrivateVL);
474 Clause->setInits(InitVL);
481 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * N));
487 "Number of private copies is not the same as the preallocated buffer");
488 std::copy(PrivateCopies.begin(), PrivateCopies.end(),
varlist_end());
492 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
493 "not the same as the "
494 "preallocated buffer");
495 std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
499 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
500 "expressions is not the same as "
501 "the preallocated buffer");
502 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
505void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
507 "Number of assignment expressions is not the same as the preallocated "
509 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
510 getDestinationExprs().end());
519 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
521 StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size());
523 Clause->setSourceExprs(SrcExprs);
524 Clause->setDestinationExprs(DstExprs);
525 Clause->setAssignmentOps(AssignmentOps);
533 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
542 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
550 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
556 "Number of privates is not the same as the preallocated buffer");
562 "Number of inits is not the same as the preallocated buffer");
563 std::copy(IL.begin(), IL.end(), getPrivates().end());
568 "Number of updates is not the same as the preallocated buffer");
569 std::copy(UL.begin(), UL.end(), getInits().end());
574 "Number of final updates is not the same as the preallocated buffer");
575 std::copy(FL.begin(), FL.end(), getUpdates().end());
581 "Number of used expressions is not the same as the preallocated buffer");
582 std::copy(UE.begin(), UE.end(), getFinals().end() + 2);
595 C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2 + VL.size() + 1));
598 ColonLoc, StepModifierLoc, EndLoc, VL.size());
600 Clause->setPrivates(PL);
601 Clause->setInits(IL);
604 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
606 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
608 std::fill(Clause->getUsedExprs().begin(), Clause->getUsedExprs().end(),
610 Clause->setStep(Step);
611 Clause->setCalcStep(CalcStep);
621 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2 + NumVars +1));
628 reinterpret_cast<Stmt **
>(getUsedExprs().begin()),
629 reinterpret_cast<Stmt **
>(llvm::find(getUsedExprs(),
nullptr)));
636 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
640 Clause->setAlignment(A);
646 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
658 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
659 "not the same as the "
660 "preallocated buffer");
661 std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
665 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
666 "expressions is not the same as "
667 "the preallocated buffer");
668 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
673 "Number of assignment expressions is not the same as the preallocated "
675 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
676 getDestinationExprs().end());
683 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
687 Clause->setSourceExprs(SrcExprs);
688 Clause->setDestinationExprs(DstExprs);
689 Clause->setAssignmentOps(AssignmentOps);
694 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
699 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
700 "not the same as the "
701 "preallocated buffer");
702 std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
706 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
707 "expressions is not the same as "
708 "the preallocated buffer");
709 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
712void OMPCopyprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
714 "Number of assignment expressions is not the same as the preallocated "
716 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
717 getDestinationExprs().end());
724 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
728 Clause->setSourceExprs(SrcExprs);
729 Clause->setDestinationExprs(DstExprs);
730 Clause->setAssignmentOps(AssignmentOps);
736 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
742 "Number of private copies is not the same as the preallocated buffer");
743 std::copy(Privates.begin(), Privates.end(),
varlist_end());
749 "Number of LHS expressions is not the same as the preallocated buffer");
750 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
756 "Number of RHS expressions is not the same as the preallocated buffer");
757 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
761 assert(ReductionOps.size() ==
varlist_size() &&
"Number of reduction "
762 "expressions is not the same "
763 "as the preallocated buffer");
764 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
768 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
769 assert(Ops.size() ==
varlist_size() &&
"Number of copy "
770 "expressions is not the same "
771 "as the preallocated buffer");
772 llvm::copy(Ops, getReductionOps().end());
775void OMPReductionClause::setInscanCopyArrayTemps(
777 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
779 "Number of copy temp expressions is not the same as the preallocated "
781 llvm::copy(CopyArrayTemps, getInscanCopyOps().end());
784void OMPReductionClause::setInscanCopyArrayElems(
786 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
788 "Number of copy temp expressions is not the same as the preallocated "
790 llvm::copy(CopyArrayElems, getInscanCopyArrayTemps().end());
802 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
803 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * VL.size()));
804 auto *Clause =
new (Mem)
806 Modifier, VL.size(), QualifierLoc, NameInfo);
808 Clause->setPrivates(Privates);
809 Clause->setLHSExprs(LHSExprs);
810 Clause->setRHSExprs(RHSExprs);
811 Clause->setReductionOps(ReductionOps);
812 Clause->setPreInitStmt(PreInit);
813 Clause->setPostUpdateExpr(PostUpdate);
814 if (Modifier == OMPC_REDUCTION_inscan) {
815 Clause->setInscanCopyOps(CopyOps);
816 Clause->setInscanCopyArrayTemps(CopyArrayTemps);
817 Clause->setInscanCopyArrayElems(CopyArrayElems);
819 assert(CopyOps.empty() &&
820 "copy operations are expected in inscan reductions only.");
821 assert(CopyArrayTemps.empty() &&
822 "copy array temps are expected in inscan reductions only.");
823 assert(CopyArrayElems.empty() &&
824 "copy array temps are expected in inscan reductions only.");
832 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
833 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * N));
835 Clause->setModifier(Modifier);
841 "Number of private copies is not the same as the preallocated buffer");
842 std::copy(Privates.begin(), Privates.end(),
varlist_end());
848 "Number of LHS expressions is not the same as the preallocated buffer");
849 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
855 "Number of RHS expressions is not the same as the preallocated buffer");
856 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
859void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
860 assert(ReductionOps.size() ==
varlist_size() &&
"Number of task reduction "
861 "expressions is not the same "
862 "as the preallocated buffer");
863 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
873 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
875 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
877 Clause->setPrivates(Privates);
878 Clause->setLHSExprs(LHSExprs);
879 Clause->setRHSExprs(RHSExprs);
880 Clause->setReductionOps(ReductionOps);
888 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
894 "Number of private copies is not the same as the preallocated buffer");
895 std::copy(Privates.begin(), Privates.end(),
varlist_end());
901 "Number of LHS expressions is not the same as the preallocated buffer");
902 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
908 "Number of RHS expressions is not the same as the preallocated buffer");
909 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
913 assert(ReductionOps.size() ==
varlist_size() &&
"Number of in reduction "
914 "expressions is not the same "
915 "as the preallocated buffer");
916 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
919void OMPInReductionClause::setTaskgroupDescriptors(
922 "Number of in reduction descriptors is not the same as the "
923 "preallocated buffer");
924 std::copy(TaskgroupDescriptors.begin(), TaskgroupDescriptors.end(),
925 getReductionOps().end());
935 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
937 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
939 Clause->setPrivates(Privates);
940 Clause->setLHSExprs(LHSExprs);
941 Clause->setRHSExprs(RHSExprs);
942 Clause->setReductionOps(ReductionOps);
943 Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
951 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * N));
970 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumSizes));
994 Clause->setLParenLoc(LParenLoc);
996 Clause->setFactor(Factor);
1010 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1012 ColonLoc, EndLoc, VL.size());
1019 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1028 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1030 new (Mem)
OMPFlushClause(StartLoc, LParenLoc, EndLoc, VL.size());
1036 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1046 Clause->setDepobj(Depobj);
1059 void *Mem =
C.Allocate(
1060 totalSizeToAlloc<Expr *>(VL.size() + 1 + NumLoops),
1064 Clause->setDependencyKind(
Data.DepKind);
1065 Clause->setDependencyLoc(
Data.DepLoc);
1066 Clause->setColonLoc(
Data.ColonLoc);
1067 Clause->setOmpAllMemoryLoc(
Data.OmpAllMemoryLoc);
1068 Clause->setModifier(DepModifier);
1070 for (
unsigned I = 0 ; I < NumLoops; ++I)
1076 unsigned NumLoops) {
1078 C.Allocate(totalSizeToAlloc<Expr *>(N + 1 + NumLoops),
1086 NumLoop < NumLoops &&
1087 "Expected sink or source depend + loop index must be less number of "
1089 auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1096 NumLoop < NumLoops &&
1097 "Expected sink or source depend + loop index must be less number of "
1099 auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1106 NumLoop < NumLoops &&
1107 "Expected sink or source depend + loop index must be less number of "
1109 const auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1113void OMPDependClause::setModifier(
Expr *DepModifier) {
1120 unsigned TotalNum = 0u;
1121 for (
auto &
C : ComponentLists)
1122 TotalNum +=
C.size();
1128 unsigned TotalNum = 0u;
1132 if (
Cache.count(VD))
1164 void *Mem =
C.Allocate(
1171 OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId,
1176 Clause->setIteratorModifier(IteratorModifier);
1178 Clause->setMapType(
Type);
1186 void *Mem =
C.Allocate(
1193 Clause->setIteratorModifier(
nullptr);
1220 void *Mem =
C.Allocate(
1227 auto *Clause =
new (Mem)
OMPToClause(MotionModifiers, MotionModifiersLoc,
1228 UDMQualifierLoc, MapperId, Locs, Sizes);
1231 Clause->setUDMapperRefs(UDMapperRefs);
1232 Clause->setClauseInfo(Declarations, ComponentLists);
1238 void *Mem =
C.Allocate(
1270 void *Mem =
C.Allocate(
1278 new (Mem)
OMPFromClause(MotionModifiers, MotionModifiersLoc,
1279 UDMQualifierLoc, MapperId, Locs, Sizes);
1282 Clause->setUDMapperRefs(UDMapperRefs);
1283 Clause->setClauseInfo(Declarations, ComponentLists);
1290 void *Mem =
C.Allocate(
1301 "Number of private copies is not the same as the preallocated buffer");
1307 "Number of inits is not the same as the preallocated buffer");
1308 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
1332 void *Mem =
C.Allocate(
1342 Clause->setPrivateCopies(PrivateVars);
1343 Clause->setInits(Inits);
1351 void *Mem =
C.Allocate(
1381 void *Mem =
C.Allocate(
1391 Clause->setClauseInfo(Declarations, ComponentLists);
1398 void *Mem =
C.Allocate(
1428 void *Mem =
C.Allocate(
1445 void *Mem =
C.Allocate(
1475 void *Mem =
C.Allocate(
1485 Clause->setClauseInfo(Declarations, ComponentLists);
1492 void *Mem =
C.Allocate(
1507 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
1516 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
1521 assert(VL.size() ==
varlist_size() &&
"Number of private references is not "
1522 "the same as the preallocated buffer");
1531 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1540 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1549 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1558 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1562void OMPUsesAllocatorsClause::setAllocatorsData(
1564 assert(
Data.size() == NumOfAllocators &&
1565 "Size of allocators data is not the same as the preallocated buffer.");
1566 for (
unsigned I = 0,
E =
Data.size(); I <
E; ++I) {
1568 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1569 static_cast<int>(ExprOffsets::Allocator)] =
1571 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1573 ExprOffsets::AllocatorTraits)] =
1576 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1577 static_cast<int>(ParenLocsOffsets::LParen)] =
1580 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1581 static_cast<int>(ParenLocsOffsets::RParen)] =
1590 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1591 static_cast<int>(ExprOffsets::Allocator)];
1593 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1595 ExprOffsets::AllocatorTraits)];
1597 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1598 static_cast<int>(ParenLocsOffsets::LParen)];
1600 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1601 static_cast<int>(ParenLocsOffsets::RParen)];
1609 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1610 static_cast<int>(ExprOffsets::Total) *
Data.size(),
1611 static_cast<int>(ParenLocsOffsets::Total) *
Data.size()));
1612 auto *Clause =
new (Mem)
1614 Clause->setAllocatorsData(
Data);
1620 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1621 static_cast<int>(ExprOffsets::Total) * N,
1622 static_cast<int>(ParenLocsOffsets::Total) * N));
1631 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(Locators.size() + 1));
1632 auto *Clause =
new (Mem)
1634 Clause->setModifier(Modifier);
1635 Clause->setVarRefs(Locators);
1641 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1653 C.Allocate(totalSizeToAlloc<Expr *>(InteropInfo.
PreferTypes.size() + 1));
1656 VarLoc, EndLoc, InteropInfo.
PreferTypes.size() + 1);
1657 Clause->setInteropVar(InteropVar);
1658 llvm::copy(InteropInfo.
PreferTypes, Clause->getTrailingObjects<
Expr *>() + 1);
1663 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1671 return new (
C)
OMPBindClause(K, KLoc, StartLoc, LParenLoc, EndLoc);
1684 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops),
1688 Clause->setDependenceType(DepType);
1689 Clause->setDependenceLoc(DepLoc);
1690 Clause->setColonLoc(ColonLoc);
1692 for (
unsigned I = 0; I < NumLoops; ++I)
1699 unsigned NumLoops) {
1700 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + NumLoops),
1706 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1707 auto *It = std::next(
getVarRefs().end(), NumLoop);
1712 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1713 auto *It = std::next(
getVarRefs().end(), NumLoop);
1718 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1719 const auto *It = std::next(
getVarRefs().end(), NumLoop);
1728 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1731 AC->setDirectiveKinds(DKVec);
1736 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1744 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1753 void *Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1762 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1772 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1780 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1790 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1800 if (
Node->getNameModifier() != OMPD_unknown)
1801 OS << getOpenMPDirectiveName(
Node->getNameModifier()) <<
": ";
1802 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1808 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1813 OS <<
"num_threads(";
1814 Node->getNumThreads()->printPretty(OS,
nullptr, Policy, 0);
1820 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
1826 Node->getSafelen()->printPretty(OS,
nullptr, Policy, 0);
1832 Node->getSimdlen()->printPretty(OS,
nullptr, Policy, 0);
1839 for (
auto *Size :
Node->getSizesRefs()) {
1842 Size->printPretty(OS,
nullptr, Policy, 0);
1853 if (
Expr *Factor =
Node->getFactor()) {
1855 Factor->printPretty(OS,
nullptr, Policy, 0);
1862 Node->getAllocator()->printPretty(OS,
nullptr, Policy, 0);
1868 Node->getNumForLoops()->printPretty(OS,
nullptr, Policy, 0);
1874 Node->getEventHandler()->printPretty(OS,
nullptr, Policy, 0);
1881 unsigned(
Node->getDefaultKind()))
1888 unsigned(
Node->getProcBindKind()))
1893 OS <<
"unified_address";
1896void OMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
1898 OS <<
"unified_shared_memory";
1902 OS <<
"reverse_offload";
1905void OMPClausePrinter::VisitOMPDynamicAllocatorsClause(
1907 OS <<
"dynamic_allocators";
1910void OMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
1912 OS <<
"atomic_default_mem_order("
1914 Node->getAtomicDefaultMemOrderKind())
1931 << cast<StringLiteral>(
Node->getMessageString())->getString() <<
"\")";
1938 Node->getFirstScheduleModifier());
1942 Node->getSecondScheduleModifier());
1947 if (
auto *
E =
Node->getChunkSize()) {
1956 if (
auto *Num =
Node->getNumForLoops()) {
1958 Num->printPretty(OS,
nullptr, Policy, 0);
1979void OMPClausePrinter::VisitOMPReadClause(
OMPReadClause *) { OS <<
"read"; }
1981void OMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause *) { OS <<
"write"; }
1985 if (
Node->isExtended()) {
1988 Node->getDependencyKind());
2006 Node->getClauseKind(),
static_cast<int>(
Node->getFailParameter()));
2014 for (
auto &
D :
Node->getDirectiveKinds()) {
2017 OS << getOpenMPDirectiveName(
D);
2025 Node->getExpr()->printPretty(OS,
nullptr, Policy, 0);
2032 for (
auto &
D :
Node->getDirectiveKinds()) {
2035 OS << getOpenMPDirectiveName(
D);
2045void OMPClausePrinter::VisitOMPNoOpenMPRoutinesClause(
2047 OS <<
"no_openmp_routines";
2051 OS <<
"no_parallelism";
2074void OMPClausePrinter::VisitOMPWeakClause(
OMPWeakClause *) { OS <<
"weak"; }
2080void OMPClausePrinter::VisitOMPSIMDClause(
OMPSIMDClause *) { OS <<
"simd"; }
2089 Node->getDevice()->printPretty(OS,
nullptr, Policy, 0);
2094 if (!
Node->varlist_empty()) {
2096 VisitOMPClauseList(
Node,
'(');
2102 if (!
Node->varlist_empty()) {
2103 OS <<
"thread_limit";
2104 VisitOMPClauseList(
Node,
'(');
2111 Node->getPriority()->printPretty(OS,
nullptr, Policy, 0);
2122 Node->getGrainsize()->printPretty(OS,
nullptr, Policy, 0);
2133 Node->getNumTasks()->printPretty(OS,
nullptr, Policy, 0);
2139 Node->getHint()->printPretty(OS,
nullptr, Policy, 0);
2148 OS <<
"prefer_type(";
2156 if (
Node->getIsTarget())
2158 if (
Node->getIsTargetSync()) {
2159 if (
Node->getIsTarget())
2164 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2170 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2202void OMPClausePrinter::VisitOMPClauseList(
T *
Node,
char StartSym) {
2203 for (
typename T::varlist_iterator I =
Node->varlist_begin(),
2204 E =
Node->varlist_end();
2206 assert(*I &&
"Expected non-null Stmt");
2207 OS << (I ==
Node->varlist_begin() ? StartSym :
',');
2208 if (
auto *DRE = dyn_cast<DeclRefExpr>(*I)) {
2209 if (isa<OMPCapturedExprDecl>(DRE->getDecl()))
2210 DRE->printPretty(OS,
nullptr, Policy, 0);
2212 DRE->getDecl()->printQualifiedName(OS);
2214 (*I)->printPretty(OS,
nullptr, Policy, 0);
2219 if (
Node->varlist_empty())
2222 if (
Expr *Allocator =
Node->getAllocator()) {
2224 Allocator->printPretty(OS,
nullptr, Policy, 0);
2226 VisitOMPClauseList(
Node,
' ');
2228 VisitOMPClauseList(
Node,
'(');
2234 if (!
Node->varlist_empty()) {
2236 VisitOMPClauseList(
Node,
'(');
2242 if (!
Node->varlist_empty()) {
2243 OS <<
"firstprivate";
2244 VisitOMPClauseList(
Node,
'(');
2250 if (!
Node->varlist_empty()) {
2251 OS <<
"lastprivate";
2264 if (!
Node->varlist_empty()) {
2266 VisitOMPClauseList(
Node,
'(');
2272 if (!
Node->varlist_empty()) {
2274 if (
Node->getModifierLoc().isValid())
2278 Node->getQualifierLoc().getNestedNameSpecifier();
2280 Node->getNameInfo().getName().getCXXOverloadedOperator();
2281 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2286 if (QualifierLoc !=
nullptr)
2287 QualifierLoc->
print(OS, Policy);
2288 OS <<
Node->getNameInfo();
2291 VisitOMPClauseList(
Node,
' ');
2296void OMPClausePrinter::VisitOMPTaskReductionClause(
2298 if (!
Node->varlist_empty()) {
2299 OS <<
"task_reduction(";
2301 Node->getQualifierLoc().getNestedNameSpecifier();
2303 Node->getNameInfo().getName().getCXXOverloadedOperator();
2304 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2309 if (QualifierLoc !=
nullptr)
2310 QualifierLoc->
print(OS, Policy);
2311 OS <<
Node->getNameInfo();
2314 VisitOMPClauseList(
Node,
' ');
2320 if (!
Node->varlist_empty()) {
2321 OS <<
"in_reduction(";
2323 Node->getQualifierLoc().getNestedNameSpecifier();
2325 Node->getNameInfo().getName().getCXXOverloadedOperator();
2326 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2331 if (QualifierLoc !=
nullptr)
2332 QualifierLoc->
print(OS, Policy);
2333 OS <<
Node->getNameInfo();
2336 VisitOMPClauseList(
Node,
' ');
2342 if (!
Node->varlist_empty()) {
2344 VisitOMPClauseList(
Node,
'(');
2345 if (
Node->getModifierLoc().isValid() ||
Node->getStep() !=
nullptr) {
2348 if (
Node->getModifierLoc().isValid()) {
2351 if (
Node->getStep() !=
nullptr) {
2352 if (
Node->getModifierLoc().isValid()) {
2356 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
2364 if (!
Node->varlist_empty()) {
2366 VisitOMPClauseList(
Node,
'(');
2367 if (
Node->getAlignment() !=
nullptr) {
2369 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
2376 if (!
Node->varlist_empty()) {
2378 VisitOMPClauseList(
Node,
'(');
2384 if (!
Node->varlist_empty()) {
2385 OS <<
"copyprivate";
2386 VisitOMPClauseList(
Node,
'(');
2392 if (!
Node->varlist_empty()) {
2393 VisitOMPClauseList(
Node,
'(');
2400 Node->getDepobj()->printPretty(OS,
nullptr, Policy, 0);
2406 if (
Expr *DepModifier =
Node->getModifier()) {
2412 bool IsOmpAllMemory =
false;
2413 if (PrintKind == OMPC_DEPEND_outallmemory) {
2414 PrintKind = OMPC_DEPEND_out;
2415 IsOmpAllMemory =
true;
2416 }
else if (PrintKind == OMPC_DEPEND_inoutallmemory) {
2417 PrintKind = OMPC_DEPEND_inout;
2418 IsOmpAllMemory =
true;
2421 if (!
Node->varlist_empty() || IsOmpAllMemory)
2423 VisitOMPClauseList(
Node,
' ');
2424 if (IsOmpAllMemory) {
2425 OS << (
Node->varlist_empty() ?
" " :
",");
2426 OS <<
"omp_all_memory";
2431template <
typename T>
2436 Node->getMapperQualifierLoc().getNestedNameSpecifier();
2438 MapperNNS->
print(OS, Policy);
2439 OS <<
Node->getMapperIdInfo() <<
')';
2442template <
typename T>
2445 if (
Expr *IteratorModifier =
Node->getIteratorModifier())
2446 IteratorModifier->printPretty(OS,
nullptr, Policy);
2450 if (!
Node->varlist_empty()) {
2455 if (
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_iterator) {
2459 Node->getMapTypeModifier(I));
2460 if (
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_mapper)
2469 VisitOMPClauseList(
Node,
' ');
2474template <
typename T>
void OMPClausePrinter::VisitOMPMotionClause(
T *
Node) {
2475 if (
Node->varlist_empty())
2477 OS << getOpenMPClauseName(
Node->getClauseKind());
2478 unsigned ModifierCount = 0;
2483 if (ModifierCount) {
2488 Node->getMotionModifier(I));
2489 if (
Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2491 if (I < ModifierCount - 1)
2496 VisitOMPClauseList(
Node,
' ');
2498 VisitOMPClauseList(
Node,
'(');
2504 VisitOMPMotionClause(
Node);
2508 VisitOMPMotionClause(
Node);
2513 OMPC_dist_schedule,
Node->getDistScheduleKind());
2514 if (
auto *
E =
Node->getChunkSize()) {
2522 OS <<
"defaultmap(";
2524 Node->getDefaultmapModifier());
2528 Node->getDefaultmapKind());
2534 if (!
Node->varlist_empty()) {
2535 OS <<
"use_device_ptr";
2536 VisitOMPClauseList(
Node,
'(');
2541void OMPClausePrinter::VisitOMPUseDeviceAddrClause(
2543 if (!
Node->varlist_empty()) {
2544 OS <<
"use_device_addr";
2545 VisitOMPClauseList(
Node,
'(');
2551 if (!
Node->varlist_empty()) {
2552 OS <<
"is_device_ptr";
2553 VisitOMPClauseList(
Node,
'(');
2559 if (!
Node->varlist_empty()) {
2560 OS <<
"has_device_addr";
2561 VisitOMPClauseList(
Node,
'(');
2567 if (!
Node->varlist_empty()) {
2568 OS <<
"nontemporal";
2569 VisitOMPClauseList(
Node,
'(');
2584 if (!
Node->varlist_empty()) {
2586 VisitOMPClauseList(
Node,
'(');
2592 if (!
Node->varlist_empty()) {
2594 VisitOMPClauseList(
Node,
'(');
2599void OMPClausePrinter::VisitOMPUsesAllocatorsClause(
2601 if (
Node->getNumberOfAllocators() == 0)
2603 OS <<
"uses_allocators(";
2604 for (
unsigned I = 0,
E =
Node->getNumberOfAllocators(); I <
E; ++I) {
2606 Data.Allocator->printPretty(OS,
nullptr, Policy);
2607 if (
Data.AllocatorTraits) {
2609 Data.AllocatorTraits->printPretty(OS,
nullptr, Policy);
2619 if (
Node->varlist_empty())
2622 char StartSym =
'(';
2623 if (
Expr *Modifier =
Node->getModifier()) {
2625 Modifier->printPretty(OS,
nullptr, Policy);
2629 VisitOMPClauseList(
Node, StartSym);
2635 Node->getThreadID()->printPretty(OS,
nullptr, Policy, 0);
2645void OMPClausePrinter::VisitOMPXDynCGroupMemClause(
2647 OS <<
"ompx_dyn_cgroup_mem(";
2648 Node->getSize()->printPretty(OS,
nullptr, Policy, 0);
2657 case OMPC_DOACROSS_source:
2660 case OMPC_DOACROSS_sink:
2663 case OMPC_DOACROSS_source_omp_cur_iteration:
2664 OS <<
"source: omp_cur_iteration";
2666 case OMPC_DOACROSS_sink_omp_cur_iteration:
2667 OS <<
"sink: omp_cur_iteration - 1";
2670 llvm_unreachable(
"unknown docaross modifier");
2672 VisitOMPClauseList(
Node,
' ');
2677 OS <<
"ompx_attribute(";
2678 bool IsFirst =
true;
2679 for (
auto &
Attr :
Node->getAttrs()) {
2693 VariantMatchInfo &VMI)
const {
2698 if (
Selector.Kind == TraitSelector::user_condition) {
2699 assert(
Selector.ScoreOrCondition &&
2700 "Ill-formed user condition, expected condition expression!");
2701 assert(
Selector.Properties.size() == 1 &&
2702 Selector.Properties.front().Kind ==
2703 TraitProperty::user_condition_unknown &&
2704 "Ill-formed user condition, expected unknown trait property!");
2706 if (std::optional<APSInt> CondVal =
2707 Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx))
2708 VMI.addTrait(CondVal->isZero() ? TraitProperty::user_condition_false
2709 : TraitProperty::user_condition_true,
2712 VMI.addTrait(TraitProperty::user_condition_false,
"<condition>");
2716 std::optional<llvm::APSInt> Score;
2717 llvm::APInt *ScorePtr =
nullptr;
2719 if ((Score =
Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx)))
2722 VMI.addTrait(TraitProperty::user_condition_false,
2723 "<non-constant-score>");
2729 if (
Set.Kind != TraitSet::construct)
2733 assert(
Selector.Properties.size() == 1 &&
2734 Selector.Properties.front().Kind ==
2735 getOpenMPContextTraitPropertyForSelector(
2737 "Ill-formed construct selector!");
2744 bool FirstSet =
true;
2749 OS << getOpenMPContextTraitSetName(
Set.Kind) <<
"={";
2751 bool FirstSelector =
true;
2755 FirstSelector =
false;
2756 OS << getOpenMPContextTraitSelectorName(
Selector.Kind);
2758 bool AllowsTraitScore =
false;
2759 bool RequiresProperty =
false;
2760 isValidTraitSelectorForTraitSet(
2761 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
2763 if (!RequiresProperty)
2767 if (
Selector.Kind == TraitSelector::user_condition) {
2769 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2776 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2780 bool FirstProperty =
true;
2784 FirstProperty =
false;
2785 OS << getOpenMPContextTraitPropertyName(
Property.Kind,
2796 std::string MangledName;
2797 llvm::raw_string_ostream OS(MangledName);
2802 bool AllowsTraitScore =
false;
2803 bool RequiresProperty =
false;
2804 isValidTraitSelectorForTraitSet(
2805 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
2808 if (!RequiresProperty ||
2809 Selector.Kind == TraitSelector::user_condition)
2814 << getOpenMPContextTraitPropertyName(
Property.Kind,
2821OMPTraitInfo::OMPTraitInfo(StringRef MangledName) {
2824 if (!MangledName.consume_front(
"$S"))
2826 if (MangledName.consumeInteger(10,
U))
2830 Set.Kind = TraitSet(
U);
2832 if (!MangledName.consume_front(
"$s"))
2834 if (MangledName.consumeInteger(10,
U))
2840 if (!MangledName.consume_front(
"$P"))
2844 std::pair<StringRef, StringRef> PropRestPair = MangledName.split(
'$');
2845 Property.RawString = PropRestPair.first;
2846 Property.Kind = getOpenMPContextTraitPropertyKind(
2848 MangledName = MangledName.drop_front(PropRestPair.first.size());
2858 TI.
print(OS, Policy);
2863 return TI ? OS << *TI : OS;
2867 ASTContext &ASTCtx, std::function<
void(StringRef)> &&DiagUnknownTrait,
2870 : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
2871 ASTCtx.getTargetInfo().getTriple()),
2872 FeatureValidityCheck([&](StringRef FeatureName) {
2875 DiagUnknownTrait(std::move(DiagUnknownTrait)) {
2878 for (llvm::omp::TraitProperty
Property : ConstructTraits)
2883 auto It = FeatureMap.find(RawString);
2884 if (It != FeatureMap.end())
2886 if (!FeatureValidityCheck(RawString))
2887 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 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.
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
Attr - This represents one attribute.
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
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) const
Print this nested name specifier to the given output stream.
This represents the 'absent' clause in the '#pragma omp assume' directive.
static OMPAbsentClause * CreateEmpty(const ASTContext &C, unsigned NumKinds)
static OMPAbsentClause * Create(const ASTContext &C, ArrayRef< OpenMPDirectiveKind > DKVec, SourceLocation Loc, SourceLocation LLoc, SourceLocation RLoc)
This represents 'acq_rel' clause in the '#pragma omp atomic|flush' directives.
This represents 'acquire' clause in the '#pragma omp atomic|flush' directives.
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.
static OMPAffinityClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N locator items.
This represents the 'align' clause in the '#pragma omp allocate' directive.
static OMPAlignClause * Create(const ASTContext &C, Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'align' clause with the given alignment.
This represents clause 'aligned' in the '#pragma omp ...' directives.
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.
This represents clause 'allocate' in the '#pragma omp ...' directives.
static OMPAllocateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, Expr *Allocator, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
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.
This represents 'at' clause in the '#pragma omp error' directive.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
This represents 'bind' clause in the '#pragma omp ...' directives.
static OMPBindClause * Create(const ASTContext &C, OpenMPBindClauseKind K, SourceLocation KLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'bind' clause with kind K ('teams', 'parallel', or 'thread').
static OMPBindClause * CreateEmpty(const ASTContext &C)
Build an empty 'bind' clause.
This represents 'capture' clause in the '#pragma omp atomic' directive.
Class that represents a component of a mappable expression.
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< const ValueDecl * > Declarations)
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
static OMPClauseWithPostUpdate * get(OMPClause *C)
Class that handles pre-initialization statement for some clauses, like 'schedule',...
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
static OMPClauseWithPreInit * get(OMPClause *C)
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=llvm::omp::OMPD_unknown)
Set pre-initialization statement for the clause.
This is a basic class for representing single OpenMP clause.
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
child_range used_children()
Get the iterator range for the expressions used in the clauses.
llvm::iterator_range< child_iterator > child_range
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents 'compare' clause in the '#pragma omp atomic' directive.
This represents the 'contains' clause in the '#pragma omp assume' directive.
static OMPContainsClause * CreateEmpty(const ASTContext &C, unsigned NumKinds)
static OMPContainsClause * Create(const ASTContext &C, ArrayRef< OpenMPDirectiveKind > DKVec, SourceLocation Loc, SourceLocation LLoc, SourceLocation RLoc)
This represents clause 'copyin' in the '#pragma omp ...' directives.
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.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
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.
This represents 'default' clause in the '#pragma omp ...' directive.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
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.
This represents implicit clause 'depobj' for the '#pragma omp depobj' directive.
static OMPDepobjClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, Expr *Depobj)
Creates clause.
static OMPDepobjClause * CreateEmpty(const ASTContext &C)
Creates an empty clause.
This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' d...
This represents 'detach' clause in the '#pragma omp task' directive.
This represents 'device' clause in the '#pragma omp ...' directive.
void setDirectiveKinds(ArrayRef< OpenMPDirectiveKind > DK)
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents the 'doacross' clause for the '#pragma omp ordered' directive.
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data.
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 'dynamic_allocators' clause in the '#pragma omp requires' directive.
This represents clause 'exclusive' in the '#pragma omp scan' directive.
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 'fail' clause in the '#pragma omp atomic' directive.
This represents 'filter' clause in the '#pragma omp ...' directive.
This represents 'final' clause in the '#pragma omp ...' directive.
child_range used_children()
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL, ArrayRef< Expr * > InitVL, Stmt *PreInit)
Creates clause with a list of variables VL.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
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 * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
static OMPFromClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr * > UDMapperRefs, ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
Representation of the 'full' clause of the '#pragma omp unroll' directive.
static OMPFullClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Build an AST node for a 'full' clause.
static OMPFullClause * CreateEmpty(const ASTContext &C)
Build an empty 'full' AST node for deserialization.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
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.
This represents 'hint' clause in the '#pragma omp ...' directive.
This represents the 'holds' clause in the '#pragma omp assume' directive.
This represents 'if' clause in the '#pragma omp ...' directive.
child_range used_children()
This represents clause 'in_reduction' in the '#pragma omp task' directives.
static OMPInReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static OMPInReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, ArrayRef< Expr * > TaskgroupDescriptors, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
This represents clause 'inclusive' in the '#pragma omp scan' directive.
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.
This represents the 'init' clause in '#pragma omp ...' directives.
static OMPInitClause * Create(const ASTContext &C, Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Creates a fully specified clause.
static OMPInitClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N expressions.
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 'lastprivate' in the '#pragma omp ...' directives.
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
This represents clause 'linear' in the '#pragma omp ...' directives.
child_range used_children()
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
void setUsedExprs(ArrayRef< Expr * > UE)
Sets the list of used expressions for the linear clause.
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
This represents clause 'map' in the '#pragma omp ...' directives.
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...
void setUDMapperRefs(ArrayRef< Expr * > DMDs)
Set the user-defined mappers that are in the trailing objects of the class.
void setClauseInfo(ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents 'message' clause in the '#pragma omp error' directive.
This represents the 'no_openmp' clause in the '#pragma omp assume' directive.
This represents the 'no_openmp_routines' clause in the '#pragma omp assume' directive.
This represents the 'no_parallelism' clause in the '#pragma omp assume' directive.
This represents 'nocontext' clause in the '#pragma omp ...' directive.
child_range used_children()
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
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.
child_range used_children()
This represents 'nowait' clause in the '#pragma omp ...' directive.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
child_range used_children()
This represents 'num_teams' clause in the '#pragma omp ...' directive.
static OMPNumTeamsClause * Create(const ASTContext &C, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, Stmt *PreInit)
Creates clause with a list of variables VL.
static OMPNumTeamsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
llvm::iterator_range< child_iterator > child_range
This represents 'order' clause in the '#pragma omp ...' directive.
This represents 'ordered' clause in the '#pragma omp ...' directive.
void setLoopCounter(unsigned NumLoop, Expr *Counter)
Set loop counter for the specified loop.
void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations)
Set number of iterations for the specified loop.
ArrayRef< Expr * > getLoopNumIterations() const
Get number of iterations for all the loops.
static OMPOrderedClause * Create(const ASTContext &C, Expr *Num, unsigned NumLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ordered' clause.
static OMPOrderedClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty clause.
Expr * getLoopCounter(unsigned NumLoop)
Get loops counter for the specified loop.
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
static OMPPartialClause * CreateEmpty(const ASTContext &C)
Build an empty 'partial' AST node for deserialization.
static OMPPartialClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, Expr *Factor)
Build an AST node for a 'partial' clause.
This represents 'priority' clause in the '#pragma omp ...' directive.
child_range used_children()
This represents clause 'private' in the '#pragma omp ...' directives.
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL)
Creates clause with a list of variables VL.
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'read' clause in the '#pragma omp atomic' directive.
This represents clause 'reduction' in the '#pragma omp ...' directives.
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N, OpenMPReductionClauseModifier Modifier)
Creates an empty clause with the place for N variables.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, ArrayRef< Expr * > CopyOps, ArrayRef< Expr * > CopyArrayTemps, ArrayRef< Expr * > CopyArrayElems, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
This represents 'simd' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'severity' clause in the '#pragma omp error' directive.
This represents clause 'shared' in the '#pragma omp ...' directives.
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents 'simdlen' clause in the '#pragma omp ...' directive.
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.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setSizesRefs(ArrayRef< Expr * > VL)
Sets the tile size expressions.
static OMPSizesClause * CreateEmpty(const ASTContext &C, unsigned NumSizes)
Build an empty 'sizes' AST node for deserialization.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
static OMPTaskReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
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, Stmt *PreInit)
Creates clause with a list of variables VL.
static OMPThreadLimitClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents clause 'to' in the '#pragma omp ...' directives.
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, ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
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.
This represents 'unified_address' clause in the '#pragma omp requires' directive.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
This represents 'update' clause in the '#pragma omp atomic' directive.
static OMPUpdateClause * CreateEmpty(const ASTContext &C, bool IsExtended)
Creates an empty clause with the place for N variables.
static OMPUpdateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates clause for 'atomic' directive.
This represents the 'use' clause in '#pragma omp ...' directives.
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)
Creates clause with a list of variables Vars.
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.
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
varlist_iterator varlist_end()
unsigned varlist_size() const
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
This represents 'weak' clause in the '#pragma omp atomic' directives.
This represents 'write' clause in the '#pragma omp atomic' directive.
This represents 'ompx_attribute' clause in a directive that might generate an outlined function.
This represents 'ompx_bare' clause in the '#pragma omp target teams ...' directive.
This represents 'ompx_dyn_cgroup_mem' clause in the '#pragma omp target ...' directive.
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
virtual bool isValidFeatureName(StringRef Feature) const
Determine whether this TargetInfo supports the given feature.
Base wrapper for a particular "section" of type source info.
The base class of the type hierarchy.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
@ OMPC_ORDER_MODIFIER_unknown
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
@ OMPC_SCHEDULE_MODIFIER_unknown
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
static constexpr unsigned NumberOfOMPMapClauseModifiers
Number of allowed map-type-modifiers.
@ Property
The type of a property.
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
@ OMPC_LASTPRIVATE_unknown
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
static constexpr unsigned NumberOfOMPMotionModifiers
Number of allowed motion-modifiers.
@ OMPC_MOTION_MODIFIER_unknown
@ OMPC_DEFAULTMAP_unknown
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
const FunctionProtoType * T
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
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.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
llvm::SmallVector< Expr *, 4 > PreferTypes
This structure contains all sizes needed for by an OMPMappableExprListClause.
unsigned NumComponentLists
Number of component lists.
unsigned NumVars
Number of expressions listed.
unsigned NumUniqueDeclarations
Number of unique base declarations.
unsigned NumComponents
Total number of expression components.
Data for list of allocators.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.
This structure contains most locations needed for by an OMPVarListClause.
Describes how types, statements, expressions, and declarations should be printed.
bool matchesISATrait(StringRef RawString) const override
See llvm::omp::OMPContext::matchesISATrait.
TargetOMPContext(ASTContext &ASTCtx, std::function< void(StringRef)> &&DiagUnknownTrait, const FunctionDecl *CurrentFunctionDecl, ArrayRef< llvm::omp::TraitProperty > ConstructTraits)