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:
144 case OMPC_defaultmap:
149 case OMPC_use_device_ptr:
150 case OMPC_use_device_addr:
151 case OMPC_is_device_ptr:
152 case OMPC_has_device_addr:
153 case OMPC_unified_address:
154 case OMPC_unified_shared_memory:
155 case OMPC_reverse_offload:
156 case OMPC_dynamic_allocators:
157 case OMPC_atomic_default_mem_order:
161 case OMPC_device_type:
163 case OMPC_nontemporal:
169 case OMPC_uses_allocators:
187 switch (
C->getClauseKind()) {
188 case OMPC_lastprivate:
192 case OMPC_task_reduction:
194 case OMPC_in_reduction:
199 case OMPC_dist_schedule:
200 case OMPC_firstprivate:
205 case OMPC_num_threads:
216 case OMPC_copyprivate:
221 case OMPC_threadprivate:
240 case OMPC_thread_limit:
246 case OMPC_defaultmap:
251 case OMPC_use_device_ptr:
252 case OMPC_use_device_addr:
253 case OMPC_is_device_ptr:
254 case OMPC_has_device_addr:
255 case OMPC_unified_address:
256 case OMPC_unified_shared_memory:
257 case OMPC_reverse_offload:
258 case OMPC_dynamic_allocators:
259 case OMPC_atomic_default_mem_order:
263 case OMPC_device_type:
265 case OMPC_nontemporal:
268 case OMPC_novariants:
273 case OMPC_uses_allocators:
290 if (
auto *DS = dyn_cast<DeclStmt>(S)) {
291 assert(DS->isSingleDecl() &&
"Only single expression must be captured.");
292 if (
auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
293 return OED->getInitAddress();
345 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
348 for (
unsigned I = 0; I < NumLoops; ++I) {
350 Clause->setLoopCounter(I,
nullptr);
357 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
359 for (
unsigned I = 0; I < NumLoops; ++I) {
361 Clause->setLoopCounter(I,
nullptr);
367 Expr *NumIterations) {
368 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
369 getTrailingObjects<Expr *>()[NumLoop] = NumIterations;
373 return llvm::ArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
377 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
378 getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop] = Counter;
382 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
383 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
387 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
388 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
402 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
406 Clause->setLParenLoc(LParenLoc);
407 Clause->setArgumentLoc(ArgumentLoc);
408 Clause->setDependencyKind(DK);
417 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
420 Clause->IsExtended =
true;
426 "Number of private copies is not the same as the preallocated buffer");
435 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
439 Clause->setPrivateCopies(PrivateVL);
445 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
451 "Number of private copies is not the same as the preallocated buffer");
457 "Number of inits is not the same as the preallocated buffer");
458 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
466 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
470 Clause->setPrivateCopies(PrivateVL);
471 Clause->setInits(InitVL);
478 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * N));
484 "Number of private copies is not the same as the preallocated buffer");
485 std::copy(PrivateCopies.begin(), PrivateCopies.end(),
varlist_end());
489 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
490 "not the same as the "
491 "preallocated buffer");
492 std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
496 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
497 "expressions is not the same as "
498 "the preallocated buffer");
499 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
502void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
504 "Number of assignment expressions is not the same as the preallocated "
506 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
507 getDestinationExprs().end());
516 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
518 StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size());
520 Clause->setSourceExprs(SrcExprs);
521 Clause->setDestinationExprs(DstExprs);
522 Clause->setAssignmentOps(AssignmentOps);
530 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
539 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
547 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
553 "Number of privates is not the same as the preallocated buffer");
559 "Number of inits is not the same as the preallocated buffer");
560 std::copy(IL.begin(), IL.end(), getPrivates().end());
565 "Number of updates is not the same as the preallocated buffer");
566 std::copy(UL.begin(), UL.end(), getInits().end());
571 "Number of final updates is not the same as the preallocated buffer");
572 std::copy(FL.begin(), FL.end(), getUpdates().end());
578 "Number of used expressions is not the same as the preallocated buffer");
579 std::copy(UE.begin(), UE.end(), getFinals().end() + 2);
591 C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2 + VL.size() + 1));
593 StartLoc, LParenLoc, Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size());
595 Clause->setPrivates(PL);
596 Clause->setInits(IL);
599 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
601 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
603 std::fill(Clause->getUsedExprs().begin(), Clause->getUsedExprs().end(),
605 Clause->setStep(Step);
606 Clause->setCalcStep(CalcStep);
616 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2 + NumVars +1));
623 reinterpret_cast<Stmt **
>(getUsedExprs().begin()),
624 reinterpret_cast<Stmt **
>(llvm::find(getUsedExprs(),
nullptr)));
631 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
635 Clause->setAlignment(A);
641 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
653 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
654 "not the same as the "
655 "preallocated buffer");
656 std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
660 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
661 "expressions is not the same as "
662 "the preallocated buffer");
663 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
668 "Number of assignment expressions is not the same as the preallocated "
670 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
671 getDestinationExprs().end());
678 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
682 Clause->setSourceExprs(SrcExprs);
683 Clause->setDestinationExprs(DstExprs);
684 Clause->setAssignmentOps(AssignmentOps);
689 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
694 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
695 "not the same as the "
696 "preallocated buffer");
697 std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
701 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
702 "expressions is not the same as "
703 "the preallocated buffer");
704 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
707void OMPCopyprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
709 "Number of assignment expressions is not the same as the preallocated "
711 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
712 getDestinationExprs().end());
719 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
723 Clause->setSourceExprs(SrcExprs);
724 Clause->setDestinationExprs(DstExprs);
725 Clause->setAssignmentOps(AssignmentOps);
731 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
737 "Number of private copies is not the same as the preallocated buffer");
738 std::copy(Privates.begin(), Privates.end(),
varlist_end());
744 "Number of LHS expressions is not the same as the preallocated buffer");
745 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
751 "Number of RHS expressions is not the same as the preallocated buffer");
752 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
756 assert(ReductionOps.size() ==
varlist_size() &&
"Number of reduction "
757 "expressions is not the same "
758 "as the preallocated buffer");
759 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
763 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
764 assert(Ops.size() ==
varlist_size() &&
"Number of copy "
765 "expressions is not the same "
766 "as the preallocated buffer");
767 llvm::copy(Ops, getReductionOps().end());
770void OMPReductionClause::setInscanCopyArrayTemps(
772 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
774 "Number of copy temp expressions is not the same as the preallocated "
776 llvm::copy(CopyArrayTemps, getInscanCopyOps().end());
779void OMPReductionClause::setInscanCopyArrayElems(
781 assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
783 "Number of copy temp expressions is not the same as the preallocated "
785 llvm::copy(CopyArrayElems, getInscanCopyArrayTemps().end());
797 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
798 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * VL.size()));
799 auto *Clause =
new (Mem)
801 Modifier, VL.size(), QualifierLoc, NameInfo);
803 Clause->setPrivates(Privates);
804 Clause->setLHSExprs(LHSExprs);
805 Clause->setRHSExprs(RHSExprs);
806 Clause->setReductionOps(ReductionOps);
807 Clause->setPreInitStmt(PreInit);
808 Clause->setPostUpdateExpr(PostUpdate);
809 if (Modifier == OMPC_REDUCTION_inscan) {
810 Clause->setInscanCopyOps(CopyOps);
811 Clause->setInscanCopyArrayTemps(CopyArrayTemps);
812 Clause->setInscanCopyArrayElems(CopyArrayElems);
814 assert(CopyOps.empty() &&
815 "copy operations are expected in inscan reductions only.");
816 assert(CopyArrayTemps.empty() &&
817 "copy array temps are expected in inscan reductions only.");
818 assert(CopyArrayElems.empty() &&
819 "copy array temps are expected in inscan reductions only.");
827 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
828 (Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * N));
830 Clause->setModifier(Modifier);
836 "Number of private copies is not the same as the preallocated buffer");
837 std::copy(Privates.begin(), Privates.end(),
varlist_end());
843 "Number of LHS expressions is not the same as the preallocated buffer");
844 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
850 "Number of RHS expressions is not the same as the preallocated buffer");
851 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
854void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
855 assert(ReductionOps.size() ==
varlist_size() &&
"Number of task reduction "
856 "expressions is not the same "
857 "as the preallocated buffer");
858 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
868 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
870 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
872 Clause->setPrivates(Privates);
873 Clause->setLHSExprs(LHSExprs);
874 Clause->setRHSExprs(RHSExprs);
875 Clause->setReductionOps(ReductionOps);
883 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
889 "Number of private copies is not the same as the preallocated buffer");
890 std::copy(Privates.begin(), Privates.end(),
varlist_end());
896 "Number of LHS expressions is not the same as the preallocated buffer");
897 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
903 "Number of RHS expressions is not the same as the preallocated buffer");
904 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
908 assert(ReductionOps.size() ==
varlist_size() &&
"Number of in reduction "
909 "expressions is not the same "
910 "as the preallocated buffer");
911 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
914void OMPInReductionClause::setTaskgroupDescriptors(
917 "Number of in reduction descriptors is not the same as the "
918 "preallocated buffer");
919 std::copy(TaskgroupDescriptors.begin(), TaskgroupDescriptors.end(),
920 getReductionOps().end());
930 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
932 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
934 Clause->setPrivates(Privates);
935 Clause->setLHSExprs(LHSExprs);
936 Clause->setRHSExprs(RHSExprs);
937 Clause->setReductionOps(ReductionOps);
938 Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
946 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * N));
965 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumSizes));
989 Clause->setLParenLoc(LParenLoc);
991 Clause->setFactor(Factor);
1005 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1007 ColonLoc, EndLoc, VL.size());
1014 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1023 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1025 new (Mem)
OMPFlushClause(StartLoc, LParenLoc, EndLoc, VL.size());
1031 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1041 Clause->setDepobj(Depobj);
1054 void *Mem =
C.Allocate(
1055 totalSizeToAlloc<Expr *>(VL.size() + 1 + NumLoops),
1059 Clause->setDependencyKind(
Data.DepKind);
1060 Clause->setDependencyLoc(
Data.DepLoc);
1061 Clause->setColonLoc(
Data.ColonLoc);
1062 Clause->setOmpAllMemoryLoc(
Data.OmpAllMemoryLoc);
1063 Clause->setModifier(DepModifier);
1065 for (
unsigned I = 0 ; I < NumLoops; ++I)
1071 unsigned NumLoops) {
1073 C.Allocate(totalSizeToAlloc<Expr *>(N + 1 + NumLoops),
1081 NumLoop < NumLoops &&
1082 "Expected sink or source depend + loop index must be less number of "
1084 auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1091 NumLoop < NumLoops &&
1092 "Expected sink or source depend + loop index must be less number of "
1094 auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1101 NumLoop < NumLoops &&
1102 "Expected sink or source depend + loop index must be less number of "
1104 const auto *It = std::next(
getVarRefs().end(), NumLoop + 1);
1108void OMPDependClause::setModifier(
Expr *DepModifier) {
1115 unsigned TotalNum = 0u;
1116 for (
auto &
C : ComponentLists)
1117 TotalNum +=
C.size();
1123 unsigned TotalNum = 0u;
1125 for (
const ValueDecl *D : Declarations) {
1126 const ValueDecl *VD = D ? cast<ValueDecl>(D->getCanonicalDecl()) :
nullptr;
1127 if (
Cache.count(VD))
1159 void *Mem =
C.Allocate(
1166 OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId,
1171 Clause->setIteratorModifier(IteratorModifier);
1173 Clause->setMapType(
Type);
1181 void *Mem =
C.Allocate(
1188 Clause->setIteratorModifier(
nullptr);
1215 void *Mem =
C.Allocate(
1222 auto *Clause =
new (Mem)
OMPToClause(MotionModifiers, MotionModifiersLoc,
1223 UDMQualifierLoc, MapperId, Locs, Sizes);
1226 Clause->setUDMapperRefs(UDMapperRefs);
1227 Clause->setClauseInfo(Declarations, ComponentLists);
1233 void *Mem =
C.Allocate(
1265 void *Mem =
C.Allocate(
1273 new (Mem)
OMPFromClause(MotionModifiers, MotionModifiersLoc,
1274 UDMQualifierLoc, MapperId, Locs, Sizes);
1277 Clause->setUDMapperRefs(UDMapperRefs);
1278 Clause->setClauseInfo(Declarations, ComponentLists);
1285 void *Mem =
C.Allocate(
1296 "Number of private copies is not the same as the preallocated buffer");
1302 "Number of inits is not the same as the preallocated buffer");
1303 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
1327 void *Mem =
C.Allocate(
1337 Clause->setPrivateCopies(PrivateVars);
1338 Clause->setInits(Inits);
1346 void *Mem =
C.Allocate(
1376 void *Mem =
C.Allocate(
1386 Clause->setClauseInfo(Declarations, ComponentLists);
1393 void *Mem =
C.Allocate(
1423 void *Mem =
C.Allocate(
1440 void *Mem =
C.Allocate(
1470 void *Mem =
C.Allocate(
1480 Clause->setClauseInfo(Declarations, ComponentLists);
1487 void *Mem =
C.Allocate(
1502 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
1511 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
1516 assert(VL.size() ==
varlist_size() &&
"Number of private references is not "
1517 "the same as the preallocated buffer");
1526 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1535 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1544 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1553 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1557void OMPUsesAllocatorsClause::setAllocatorsData(
1559 assert(
Data.size() == NumOfAllocators &&
1560 "Size of allocators data is not the same as the preallocated buffer.");
1561 for (
unsigned I = 0, E =
Data.size(); I < E; ++I) {
1563 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1564 static_cast<int>(ExprOffsets::Allocator)] =
1566 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1568 ExprOffsets::AllocatorTraits)] =
1571 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1572 static_cast<int>(ParenLocsOffsets::LParen)] =
1575 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1576 static_cast<int>(ParenLocsOffsets::RParen)] =
1585 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1586 static_cast<int>(ExprOffsets::Allocator)];
1588 getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1590 ExprOffsets::AllocatorTraits)];
1592 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1593 static_cast<int>(ParenLocsOffsets::LParen)];
1595 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1596 static_cast<int>(ParenLocsOffsets::RParen)];
1604 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1605 static_cast<int>(ExprOffsets::Total) *
Data.size(),
1606 static_cast<int>(ParenLocsOffsets::Total) *
Data.size()));
1607 auto *Clause =
new (Mem)
1609 Clause->setAllocatorsData(
Data);
1615 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1616 static_cast<int>(ExprOffsets::Total) * N,
1617 static_cast<int>(ParenLocsOffsets::Total) * N));
1626 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(Locators.size() + 1));
1627 auto *Clause =
new (Mem)
1629 Clause->setModifier(Modifier);
1630 Clause->setVarRefs(Locators);
1636 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1648 C.Allocate(totalSizeToAlloc<Expr *>(InteropInfo.
PreferTypes.size() + 1));
1651 VarLoc, EndLoc, InteropInfo.
PreferTypes.size() + 1);
1652 Clause->setInteropVar(InteropVar);
1653 llvm::copy(InteropInfo.
PreferTypes, Clause->getTrailingObjects<
Expr *>() + 1);
1658 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1666 return new (
C)
OMPBindClause(K, KLoc, StartLoc, LParenLoc, EndLoc);
1679 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops),
1683 Clause->setDependenceType(DepType);
1684 Clause->setDependenceLoc(DepLoc);
1685 Clause->setColonLoc(ColonLoc);
1687 for (
unsigned I = 0; I < NumLoops; ++I)
1694 unsigned NumLoops) {
1695 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + NumLoops),
1701 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1702 auto *It = std::next(
getVarRefs().end(), NumLoop);
1707 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1708 auto *It = std::next(
getVarRefs().end(), NumLoop);
1713 assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1714 const auto *It = std::next(
getVarRefs().end(), NumLoop);
1724 if (
Node->getNameModifier() != OMPD_unknown)
1725 OS << getOpenMPDirectiveName(
Node->getNameModifier()) <<
": ";
1726 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1732 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1737 OS <<
"num_threads(";
1738 Node->getNumThreads()->printPretty(OS,
nullptr, Policy, 0);
1744 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
1750 Node->getSafelen()->printPretty(OS,
nullptr, Policy, 0);
1756 Node->getSimdlen()->printPretty(OS,
nullptr, Policy, 0);
1763 for (
auto *Size :
Node->getSizesRefs()) {
1766 Size->printPretty(OS,
nullptr, Policy, 0);
1777 if (
Expr *Factor =
Node->getFactor()) {
1779 Factor->printPretty(OS,
nullptr, Policy, 0);
1786 Node->getAllocator()->printPretty(OS,
nullptr, Policy, 0);
1792 Node->getNumForLoops()->printPretty(OS,
nullptr, Policy, 0);
1798 Node->getEventHandler()->printPretty(OS,
nullptr, Policy, 0);
1805 unsigned(
Node->getDefaultKind()))
1812 unsigned(
Node->getProcBindKind()))
1817 OS <<
"unified_address";
1820void OMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
1822 OS <<
"unified_shared_memory";
1826 OS <<
"reverse_offload";
1829void OMPClausePrinter::VisitOMPDynamicAllocatorsClause(
1831 OS <<
"dynamic_allocators";
1834void OMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
1836 OS <<
"atomic_default_mem_order("
1838 Node->getAtomicDefaultMemOrderKind())
1855 << cast<StringLiteral>(
Node->getMessageString())->getString() <<
"\")";
1862 Node->getFirstScheduleModifier());
1866 Node->getSecondScheduleModifier());
1871 if (
auto *E =
Node->getChunkSize()) {
1873 E->printPretty(OS,
nullptr, Policy);
1880 if (
auto *Num =
Node->getNumForLoops()) {
1882 Num->printPretty(OS,
nullptr, Policy, 0);
1903void OMPClausePrinter::VisitOMPReadClause(
OMPReadClause *) { OS <<
"read"; }
1905void OMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause *) { OS <<
"write"; }
1909 if (
Node->isExtended()) {
1912 Node->getDependencyKind());
1949void OMPClausePrinter::VisitOMPSIMDClause(
OMPSIMDClause *) { OS <<
"simd"; }
1958 Node->getDevice()->printPretty(OS,
nullptr, Policy, 0);
1964 Node->getNumTeams()->printPretty(OS,
nullptr, Policy, 0);
1969 OS <<
"thread_limit(";
1970 Node->getThreadLimit()->printPretty(OS,
nullptr, Policy, 0);
1976 Node->getPriority()->printPretty(OS,
nullptr, Policy, 0);
1987 Node->getGrainsize()->printPretty(OS,
nullptr, Policy, 0);
1998 Node->getNumTasks()->printPretty(OS,
nullptr, Policy, 0);
2004 Node->getHint()->printPretty(OS,
nullptr, Policy, 0);
2011 for (
const Expr *E :
Node->prefs()) {
2013 OS <<
"prefer_type(";
2016 E->printPretty(OS,
nullptr, Policy);
2021 if (
Node->getIsTarget())
2023 if (
Node->getIsTargetSync()) {
2024 if (
Node->getIsTarget())
2029 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2035 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2041 if (
Expr *E =
Node->getInteropVar()) {
2043 E->printPretty(OS,
nullptr, Policy);
2050 if (
Expr *E =
Node->getCondition()) {
2052 E->printPretty(OS,
nullptr, Policy, 0);
2059 if (
Expr *E =
Node->getCondition()) {
2061 E->printPretty(OS,
nullptr, Policy, 0);
2067void OMPClausePrinter::VisitOMPClauseList(T *
Node,
char StartSym) {
2068 for (
typename T::varlist_iterator I =
Node->varlist_begin(),
2069 E =
Node->varlist_end();
2071 assert(*I &&
"Expected non-null Stmt");
2072 OS << (I ==
Node->varlist_begin() ? StartSym :
',');
2073 if (
auto *DRE = dyn_cast<DeclRefExpr>(*I)) {
2074 if (isa<OMPCapturedExprDecl>(DRE->getDecl()))
2075 DRE->printPretty(OS,
nullptr, Policy, 0);
2077 DRE->getDecl()->printQualifiedName(OS);
2079 (*I)->printPretty(OS,
nullptr, Policy, 0);
2084 if (
Node->varlist_empty())
2087 if (
Expr *Allocator =
Node->getAllocator()) {
2089 Allocator->printPretty(OS,
nullptr, Policy, 0);
2091 VisitOMPClauseList(
Node,
' ');
2093 VisitOMPClauseList(
Node,
'(');
2099 if (!
Node->varlist_empty()) {
2101 VisitOMPClauseList(
Node,
'(');
2107 if (!
Node->varlist_empty()) {
2108 OS <<
"firstprivate";
2109 VisitOMPClauseList(
Node,
'(');
2115 if (!
Node->varlist_empty()) {
2116 OS <<
"lastprivate";
2129 if (!
Node->varlist_empty()) {
2131 VisitOMPClauseList(
Node,
'(');
2137 if (!
Node->varlist_empty()) {
2139 if (
Node->getModifierLoc().isValid())
2143 Node->getQualifierLoc().getNestedNameSpecifier();
2145 Node->getNameInfo().getName().getCXXOverloadedOperator();
2146 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2151 if (QualifierLoc !=
nullptr)
2152 QualifierLoc->
print(OS, Policy);
2153 OS <<
Node->getNameInfo();
2156 VisitOMPClauseList(
Node,
' ');
2161void OMPClausePrinter::VisitOMPTaskReductionClause(
2163 if (!
Node->varlist_empty()) {
2164 OS <<
"task_reduction(";
2166 Node->getQualifierLoc().getNestedNameSpecifier();
2168 Node->getNameInfo().getName().getCXXOverloadedOperator();
2169 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2174 if (QualifierLoc !=
nullptr)
2175 QualifierLoc->
print(OS, Policy);
2176 OS <<
Node->getNameInfo();
2179 VisitOMPClauseList(
Node,
' ');
2185 if (!
Node->varlist_empty()) {
2186 OS <<
"in_reduction(";
2188 Node->getQualifierLoc().getNestedNameSpecifier();
2190 Node->getNameInfo().getName().getCXXOverloadedOperator();
2191 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
2196 if (QualifierLoc !=
nullptr)
2197 QualifierLoc->
print(OS, Policy);
2198 OS <<
Node->getNameInfo();
2201 VisitOMPClauseList(
Node,
' ');
2207 if (!
Node->varlist_empty()) {
2209 if (
Node->getModifierLoc().isValid()) {
2213 VisitOMPClauseList(
Node,
'(');
2214 if (
Node->getModifierLoc().isValid())
2216 if (
Node->getStep() !=
nullptr) {
2218 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
2225 if (!
Node->varlist_empty()) {
2227 VisitOMPClauseList(
Node,
'(');
2228 if (
Node->getAlignment() !=
nullptr) {
2230 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
2237 if (!
Node->varlist_empty()) {
2239 VisitOMPClauseList(
Node,
'(');
2245 if (!
Node->varlist_empty()) {
2246 OS <<
"copyprivate";
2247 VisitOMPClauseList(
Node,
'(');
2253 if (!
Node->varlist_empty()) {
2254 VisitOMPClauseList(
Node,
'(');
2261 Node->getDepobj()->printPretty(OS,
nullptr, Policy, 0);
2267 if (
Expr *DepModifier =
Node->getModifier()) {
2273 bool IsOmpAllMemory =
false;
2274 if (PrintKind == OMPC_DEPEND_outallmemory) {
2275 PrintKind = OMPC_DEPEND_out;
2276 IsOmpAllMemory =
true;
2277 }
else if (PrintKind == OMPC_DEPEND_inoutallmemory) {
2278 PrintKind = OMPC_DEPEND_inout;
2279 IsOmpAllMemory =
true;
2282 if (!
Node->varlist_empty() || IsOmpAllMemory)
2284 VisitOMPClauseList(
Node,
' ');
2285 if (IsOmpAllMemory) {
2286 OS << (
Node->varlist_empty() ?
" " :
",");
2287 OS <<
"omp_all_memory";
2292template <
typename T>
2297 Node->getMapperQualifierLoc().getNestedNameSpecifier();
2299 MapperNNS->
print(OS, Policy);
2300 OS <<
Node->getMapperIdInfo() <<
')';
2303template <
typename T>
2306 if (
Expr *IteratorModifier =
Node->getIteratorModifier())
2307 IteratorModifier->printPretty(OS,
nullptr, Policy);
2311 if (!
Node->varlist_empty()) {
2316 if (
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_iterator) {
2320 Node->getMapTypeModifier(I));
2321 if (
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_mapper)
2330 VisitOMPClauseList(
Node,
' ');
2335template <
typename T>
void OMPClausePrinter::VisitOMPMotionClause(T *
Node) {
2336 if (
Node->varlist_empty())
2338 OS << getOpenMPClauseName(
Node->getClauseKind());
2339 unsigned ModifierCount = 0;
2344 if (ModifierCount) {
2349 Node->getMotionModifier(I));
2350 if (
Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2352 if (I < ModifierCount - 1)
2357 VisitOMPClauseList(
Node,
' ');
2359 VisitOMPClauseList(
Node,
'(');
2365 VisitOMPMotionClause(
Node);
2369 VisitOMPMotionClause(
Node);
2374 OMPC_dist_schedule,
Node->getDistScheduleKind());
2375 if (
auto *E =
Node->getChunkSize()) {
2377 E->printPretty(OS,
nullptr, Policy);
2383 OS <<
"defaultmap(";
2385 Node->getDefaultmapModifier());
2389 Node->getDefaultmapKind());
2395 if (!
Node->varlist_empty()) {
2396 OS <<
"use_device_ptr";
2397 VisitOMPClauseList(
Node,
'(');
2402void OMPClausePrinter::VisitOMPUseDeviceAddrClause(
2404 if (!
Node->varlist_empty()) {
2405 OS <<
"use_device_addr";
2406 VisitOMPClauseList(
Node,
'(');
2412 if (!
Node->varlist_empty()) {
2413 OS <<
"is_device_ptr";
2414 VisitOMPClauseList(
Node,
'(');
2420 if (!
Node->varlist_empty()) {
2421 OS <<
"has_device_addr";
2422 VisitOMPClauseList(
Node,
'(');
2428 if (!
Node->varlist_empty()) {
2429 OS <<
"nontemporal";
2430 VisitOMPClauseList(
Node,
'(');
2445 if (!
Node->varlist_empty()) {
2447 VisitOMPClauseList(
Node,
'(');
2453 if (!
Node->varlist_empty()) {
2455 VisitOMPClauseList(
Node,
'(');
2460void OMPClausePrinter::VisitOMPUsesAllocatorsClause(
2462 if (
Node->getNumberOfAllocators() == 0)
2464 OS <<
"uses_allocators(";
2465 for (
unsigned I = 0, E =
Node->getNumberOfAllocators(); I < E; ++I) {
2467 Data.Allocator->printPretty(OS,
nullptr, Policy);
2468 if (
Data.AllocatorTraits) {
2470 Data.AllocatorTraits->printPretty(OS,
nullptr, Policy);
2480 if (
Node->varlist_empty())
2483 char StartSym =
'(';
2484 if (
Expr *Modifier =
Node->getModifier()) {
2486 Modifier->printPretty(OS,
nullptr, Policy);
2490 VisitOMPClauseList(
Node, StartSym);
2496 Node->getThreadID()->printPretty(OS,
nullptr, Policy, 0);
2506void OMPClausePrinter::VisitOMPXDynCGroupMemClause(
2508 OS <<
"ompx_dyn_cgroup_mem(";
2509 Node->getSize()->printPretty(OS,
nullptr, Policy, 0);
2518 case OMPC_DOACROSS_source:
2521 case OMPC_DOACROSS_sink:
2524 case OMPC_DOACROSS_source_omp_cur_iteration:
2525 OS <<
"source: omp_cur_iteration";
2527 case OMPC_DOACROSS_sink_omp_cur_iteration:
2528 OS <<
"sink: omp_cur_iteration - 1";
2531 llvm_unreachable(
"unknown docaross modifier");
2533 VisitOMPClauseList(
Node,
' ');
2538 OS <<
"ompx_attribute(";
2539 bool IsFirst =
true;
2540 for (
auto &
Attr :
Node->getAttrs()) {
2550 VariantMatchInfo &VMI)
const {
2555 if (
Selector.Kind == TraitSelector::user_condition) {
2556 assert(
Selector.ScoreOrCondition &&
2557 "Ill-formed user condition, expected condition expression!");
2558 assert(
Selector.Properties.size() == 1 &&
2559 Selector.Properties.front().Kind ==
2560 TraitProperty::user_condition_unknown &&
2561 "Ill-formed user condition, expected unknown trait property!");
2563 if (std::optional<APSInt> CondVal =
2564 Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx))
2565 VMI.addTrait(CondVal->isZero() ? TraitProperty::user_condition_false
2566 : TraitProperty::user_condition_true,
2569 VMI.addTrait(TraitProperty::user_condition_false,
"<condition>");
2573 std::optional<llvm::APSInt> Score;
2574 llvm::APInt *ScorePtr =
nullptr;
2576 if ((Score =
Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx)))
2579 VMI.addTrait(TraitProperty::user_condition_false,
2580 "<non-constant-score>");
2586 if (Set.Kind != TraitSet::construct)
2590 assert(
Selector.Properties.size() == 1 &&
2591 Selector.Properties.front().Kind ==
2592 getOpenMPContextTraitPropertyForSelector(
2594 "Ill-formed construct selector!");
2601 bool FirstSet =
true;
2606 OS << getOpenMPContextTraitSetName(Set.Kind) <<
"={";
2608 bool FirstSelector =
true;
2612 FirstSelector =
false;
2613 OS << getOpenMPContextTraitSelectorName(
Selector.Kind);
2615 bool AllowsTraitScore =
false;
2616 bool RequiresProperty =
false;
2617 isValidTraitSelectorForTraitSet(
2618 Selector.Kind, Set.Kind, AllowsTraitScore, RequiresProperty);
2620 if (!RequiresProperty)
2624 if (
Selector.Kind == TraitSelector::user_condition) {
2626 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2633 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2637 bool FirstProperty =
true;
2641 FirstProperty =
false;
2642 OS << getOpenMPContextTraitPropertyName(
Property.Kind,
2653 std::string MangledName;
2654 llvm::raw_string_ostream OS(MangledName);
2656 OS <<
'$' <<
'S' <<
unsigned(Set.Kind);
2659 bool AllowsTraitScore =
false;
2660 bool RequiresProperty =
false;
2661 isValidTraitSelectorForTraitSet(
2662 Selector.Kind, Set.Kind, AllowsTraitScore, RequiresProperty);
2665 if (!RequiresProperty ||
2666 Selector.Kind == TraitSelector::user_condition)
2671 << getOpenMPContextTraitPropertyName(
Property.Kind,
2678OMPTraitInfo::OMPTraitInfo(StringRef MangledName) {
2681 if (!MangledName.consume_front(
"$S"))
2683 if (MangledName.consumeInteger(10,
U))
2687 Set.
Kind = TraitSet(
U);
2689 if (!MangledName.consume_front(
"$s"))
2691 if (MangledName.consumeInteger(10,
U))
2697 if (!MangledName.consume_front(
"$P"))
2701 std::pair<StringRef, StringRef> PropRestPair = MangledName.split(
'$');
2702 Property.RawString = PropRestPair.first;
2703 Property.Kind = getOpenMPContextTraitPropertyKind(
2705 MangledName = MangledName.drop_front(PropRestPair.first.size());
2715 TI.
print(OS, Policy);
2720 return TI ? OS << *TI : OS;
2724 ASTContext &ASTCtx, std::function<
void(StringRef)> &&DiagUnknownTrait,
2727 : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
2728 ASTCtx.getTargetInfo().getTriple()),
2729 FeatureValidityCheck([&](StringRef FeatureName) {
2732 DiagUnknownTrait(std::move(DiagUnknownTrait)) {
2735 for (llvm::omp::TraitProperty
Property : ConstructTraits)
2740 auto It = FeatureMap.find(RawString);
2741 if (It != FeatureMap.end())
2743 if (!FeatureValidityCheck(RawString))
2744 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.
TypePropertyCache< Private > Cache
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
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 '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 'shedule', 'firstprivate' etc.
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 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.
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 '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 '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 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 '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.
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.
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 '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_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.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
@ 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.
@ C
Languages that the frontend can parse and compile.
@ 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 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.
YAML serialization mapping.
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.
llvm::SmallVector< OMPTraitSelector, 2 > Selectors
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)