;
35#define GEN_CLANG_CLAUSE_CLASS 36#define CLAUSE_CLASS(Enum, Str, Class) \ 38 return static_cast<Class *>(this)->children(); 39#include "llvm/Frontend/OpenMP/OMP.inc" 41llvm_unreachable(
"unknown OMPClause");
46#define GEN_CLANG_CLAUSE_CLASS 47#define CLAUSE_CLASS(Enum, Str, Class) \ 49 return static_cast<Class *>(this)->used_children(); 50#define CLAUSE_NO_CLASS(Enum, Str) \ 53#include "llvm/Frontend/OpenMP/OMP.inc" 55llvm_unreachable(
"unknown OMPClause");
64 switch(
C->getClauseKind()) {
67 caseOMPC_dist_schedule:
69 caseOMPC_firstprivate:
71 caseOMPC_lastprivate:
75 caseOMPC_task_reduction:
77 caseOMPC_in_reduction:
83 caseOMPC_num_threads:
87 caseOMPC_thread_limit:
105 caseOMPC_ompx_dyn_cgroup_mem:
119 caseOMPC_copyprivate:
124 caseOMPC_threadprivate:
144 caseOMPC_defaultmap:
149 caseOMPC_use_device_ptr:
150 caseOMPC_use_device_addr:
151 caseOMPC_is_device_ptr:
152 caseOMPC_has_device_addr:
153 caseOMPC_unified_address:
154 caseOMPC_unified_shared_memory:
155 caseOMPC_reverse_offload:
156 caseOMPC_dynamic_allocators:
157 caseOMPC_atomic_default_mem_order:
161 caseOMPC_device_type:
163 caseOMPC_nontemporal:
169 caseOMPC_uses_allocators:
188 switch(
C->getClauseKind()) {
189 caseOMPC_lastprivate:
193 caseOMPC_task_reduction:
195 caseOMPC_in_reduction:
200 caseOMPC_dist_schedule:
201 caseOMPC_firstprivate:
206 caseOMPC_num_threads:
217 caseOMPC_copyprivate:
222 caseOMPC_threadprivate:
242 caseOMPC_thread_limit:
248 caseOMPC_defaultmap:
253 caseOMPC_use_device_ptr:
254 caseOMPC_use_device_addr:
255 caseOMPC_is_device_ptr:
256 caseOMPC_has_device_addr:
257 caseOMPC_unified_address:
258 caseOMPC_unified_shared_memory:
259 caseOMPC_reverse_offload:
260 caseOMPC_dynamic_allocators:
261 caseOMPC_atomic_default_mem_order:
265 caseOMPC_device_type:
267 caseOMPC_nontemporal:
270 caseOMPC_novariants:
275 caseOMPC_uses_allocators:
292 if(
auto*DS = dyn_cast<DeclStmt>(S)) {
293assert(DS->isSingleDecl() &&
"Only single expression must be captured.");
294 if(
auto*OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
295 returnOED->getInitAddress();
347 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
350 for(
unsignedI = 0; I < NumLoops; ++I) {
352Clause->setLoopCounter(I,
nullptr);
359 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
361 for(
unsignedI = 0; I < NumLoops; ++I) {
363Clause->setLoopCounter(I,
nullptr);
369 Expr*NumIterations) {
370assert(NumLoop < NumberOfLoops &&
"out of loops number.");
371getTrailingObjects<Expr *>()[NumLoop] = NumIterations;
375 return llvm::ArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
379assert(NumLoop < NumberOfLoops &&
"out of loops number.");
380getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop] = Counter;
384assert(NumLoop < NumberOfLoops &&
"out of loops number.");
385 returngetTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
389assert(NumLoop < NumberOfLoops &&
"out of loops number.");
390 returngetTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
404 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
408Clause->setLParenLoc(LParenLoc);
409Clause->setArgumentLoc(ArgumentLoc);
410Clause->setDependencyKind(DK);
419 C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
422Clause->IsExtended =
true;
428 "Number of private copies is not the same as the preallocated buffer");
437 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
441Clause->setPrivateCopies(PrivateVL);
447 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
453 "Number of private copies is not the same as the preallocated buffer");
459 "Number of inits is not the same as the preallocated buffer");
460std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
468 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
472Clause->setPrivateCopies(PrivateVL);
473Clause->setInits(InitVL);
480 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(3 * N));
486 "Number of private copies is not the same as the preallocated buffer");
487std::copy(PrivateCopies.begin(), PrivateCopies.end(),
varlist_end());
491assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is " 492 "not the same as the " 493 "preallocated buffer");
494std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
498assert(DstExprs.size() ==
varlist_size() &&
"Number of destination " 499 "expressions is not the same as " 500 "the preallocated buffer");
501std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
504voidOMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *>AssignmentOps) {
506 "Number of assignment expressions is not the same as the preallocated " 508std::copy(AssignmentOps.begin(), AssignmentOps.end(),
509getDestinationExprs().end());
518 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
520StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size());
522Clause->setSourceExprs(SrcExprs);
523Clause->setDestinationExprs(DstExprs);
524Clause->setAssignmentOps(AssignmentOps);
532 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
541 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
549 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
555 "Number of privates is not the same as the preallocated buffer");
561 "Number of inits is not the same as the preallocated buffer");
562std::copy(IL.begin(), IL.end(), getPrivates().end());
567 "Number of updates is not the same as the preallocated buffer");
568std::copy(UL.begin(), UL.end(), getInits().end());
573 "Number of final updates is not the same as the preallocated buffer");
574std::copy(FL.begin(), FL.end(), getUpdates().end());
580 "Number of used expressions is not the same as the preallocated buffer");
581std::copy(UE.begin(), UE.end(), getFinals().end() + 2);
594 C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2 + VL.size() + 1));
597ColonLoc, StepModifierLoc, EndLoc, VL.size());
599Clause->setPrivates(PL);
600Clause->setInits(IL);
603std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
605std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
607std::fill(Clause->getUsedExprs().begin(), Clause->getUsedExprs().end(),
609Clause->setStep(Step);
610Clause->setCalcStep(CalcStep);
620 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2 + NumVars +1));
627 reinterpret_cast<Stmt**
>(getUsedExprs().begin()),
628 reinterpret_cast<Stmt**
>(llvm::find(getUsedExprs(),
nullptr)));
635 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
639Clause->setAlignment(A);
645 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
657assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is " 658 "not the same as the " 659 "preallocated buffer");
660std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
664assert(DstExprs.size() ==
varlist_size() &&
"Number of destination " 665 "expressions is not the same as " 666 "the preallocated buffer");
667std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
672 "Number of assignment expressions is not the same as the preallocated " 674std::copy(AssignmentOps.begin(), AssignmentOps.end(),
675getDestinationExprs().end());
682 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
686Clause->setSourceExprs(SrcExprs);
687Clause->setDestinationExprs(DstExprs);
688Clause->setAssignmentOps(AssignmentOps);
693 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
698assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is " 699 "not the same as the " 700 "preallocated buffer");
701std::copy(SrcExprs.begin(), SrcExprs.end(),
varlist_end());
705assert(DstExprs.size() ==
varlist_size() &&
"Number of destination " 706 "expressions is not the same as " 707 "the preallocated buffer");
708std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
711voidOMPCopyprivateClause::setAssignmentOps(
ArrayRef<Expr *>AssignmentOps) {
713 "Number of assignment expressions is not the same as the preallocated " 715std::copy(AssignmentOps.begin(), AssignmentOps.end(),
716getDestinationExprs().end());
723 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
727Clause->setSourceExprs(SrcExprs);
728Clause->setDestinationExprs(DstExprs);
729Clause->setAssignmentOps(AssignmentOps);
735 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
741 "Number of private copies is not the same as the preallocated buffer");
742std::copy(Privates.begin(), Privates.end(),
varlist_end());
748 "Number of LHS expressions is not the same as the preallocated buffer");
749std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
755 "Number of RHS expressions is not the same as the preallocated buffer");
756std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
760assert(ReductionOps.size() ==
varlist_size() &&
"Number of reduction " 761 "expressions is not the same " 762 "as the preallocated buffer");
763std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
767assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
768assert(Ops.size() ==
varlist_size() &&
"Number of copy " 769 "expressions is not the same " 770 "as the preallocated buffer");
771llvm::copy(Ops, getReductionOps().end());
774voidOMPReductionClause::setInscanCopyArrayTemps(
776assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
778 "Number of copy temp expressions is not the same as the preallocated " 780llvm::copy(CopyArrayTemps, getInscanCopyOps().end());
783voidOMPReductionClause::setInscanCopyArrayElems(
785assert(Modifier == OMPC_REDUCTION_inscan &&
"Expected inscan reduction.");
787 "Number of copy temp expressions is not the same as the preallocated " 789llvm::copy(CopyArrayElems, getInscanCopyArrayTemps().end());
801 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
802(Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * VL.size()));
803 auto*Clause =
new(Mem)
805Modifier, VL.size(), QualifierLoc, NameInfo);
807Clause->setPrivates(Privates);
808Clause->setLHSExprs(LHSExprs);
809Clause->setRHSExprs(RHSExprs);
810Clause->setReductionOps(ReductionOps);
811Clause->setPreInitStmt(PreInit);
812Clause->setPostUpdateExpr(PostUpdate);
813 if(Modifier == OMPC_REDUCTION_inscan) {
814Clause->setInscanCopyOps(CopyOps);
815Clause->setInscanCopyArrayTemps(CopyArrayTemps);
816Clause->setInscanCopyArrayElems(CopyArrayElems);
818assert(CopyOps.empty() &&
819 "copy operations are expected in inscan reductions only.");
820assert(CopyArrayTemps.empty() &&
821 "copy array temps are expected in inscan reductions only.");
822assert(CopyArrayElems.empty() &&
823 "copy array temps are expected in inscan reductions only.");
831 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(
832(Modifier == OMPC_REDUCTION_inscan ? 8 : 5) * N));
834Clause->setModifier(Modifier);
840 "Number of private copies is not the same as the preallocated buffer");
841std::copy(Privates.begin(), Privates.end(),
varlist_end());
847 "Number of LHS expressions is not the same as the preallocated buffer");
848std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
854 "Number of RHS expressions is not the same as the preallocated buffer");
855std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
858voidOMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *>ReductionOps) {
859assert(ReductionOps.size() ==
varlist_size() &&
"Number of task reduction " 860 "expressions is not the same " 861 "as the preallocated buffer");
862std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
872 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
874StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
876Clause->setPrivates(Privates);
877Clause->setLHSExprs(LHSExprs);
878Clause->setRHSExprs(RHSExprs);
879Clause->setReductionOps(ReductionOps);
887 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
893 "Number of private copies is not the same as the preallocated buffer");
894std::copy(Privates.begin(), Privates.end(),
varlist_end());
900 "Number of LHS expressions is not the same as the preallocated buffer");
901std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
907 "Number of RHS expressions is not the same as the preallocated buffer");
908std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
912assert(ReductionOps.size() ==
varlist_size() &&
"Number of in reduction " 913 "expressions is not the same " 914 "as the preallocated buffer");
915std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
918voidOMPInReductionClause::setTaskgroupDescriptors(
920assert(TaskgroupDescriptors.size() ==
varlist_size() &&
921 "Number of in reduction descriptors is not the same as the " 922 "preallocated buffer");
923std::copy(TaskgroupDescriptors.begin(), TaskgroupDescriptors.end(),
924getReductionOps().end());
934 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
936StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
938Clause->setPrivates(Privates);
939Clause->setLHSExprs(LHSExprs);
940Clause->setRHSExprs(RHSExprs);
941Clause->setReductionOps(ReductionOps);
942Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
950 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(6 * N));
969 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumSizes));
982Clause->setArgRefs(Args);
988 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumLoops));
1012Clause->setLParenLoc(LParenLoc);
1014Clause->setFactor(Factor);
1030 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1032StartLoc, LParenLoc, Allocator, Alignment, ColonLoc, Modifier1,
1033Modifier1Loc, Modifier2, Modifier2Loc, EndLoc, VL.size());
1041 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1050 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
1052 new(Mem)
OMPFlushClause(StartLoc, LParenLoc, EndLoc, VL.size());
1058 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1068Clause->setDepobj(Depobj);
1081 void*Mem =
C.Allocate(
1082totalSizeToAlloc<Expr *>(VL.size() +
1 + NumLoops),
1086Clause->setDependencyKind(
Data.DepKind);
1087Clause->setDependencyLoc(
Data.DepLoc);
1088Clause->setColonLoc(
Data.ColonLoc);
1089Clause->setOmpAllMemoryLoc(
Data.OmpAllMemoryLoc);
1090Clause->setModifier(DepModifier);
1092 for(
unsignedI = 0 ; I < NumLoops; ++I)
1098 unsignedNumLoops) {
1100 C.Allocate(totalSizeToAlloc<Expr *>(N +
1 + NumLoops),
1108NumLoop < NumLoops &&
1109 "Expected sink or source depend + loop index must be less number of " 1111 auto*It = std::next(
getVarRefs().end(), NumLoop + 1);
1118NumLoop < NumLoops &&
1119 "Expected sink or source depend + loop index must be less number of " 1121 auto*It = std::next(
getVarRefs().end(), NumLoop + 1);
1128NumLoop < NumLoops &&
1129 "Expected sink or source depend + loop index must be less number of " 1131 const auto*It = std::next(
getVarRefs().end(), NumLoop + 1);
1135voidOMPDependClause::setModifier(
Expr*DepModifier) {
1142 unsignedTotalNum = 0u;
1143 for(
auto&
C: ComponentLists)
1144TotalNum +=
C.size();
1153UniqueDecls.insert(VD);
1155 returnUniqueDecls.size();
1182 void*Mem =
C.Allocate(
1189 OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId,
1194Clause->setIteratorModifier(IteratorModifier);
1196Clause->setMapType(
Type);
1204 void*Mem =
C.Allocate(
1211Clause->setIteratorModifier(
nullptr);
1238 void*Mem =
C.Allocate(
1245 auto*Clause =
new(Mem)
OMPToClause(MotionModifiers, MotionModifiersLoc,
1246UDMQualifierLoc, MapperId, Locs, Sizes);
1249Clause->setUDMapperRefs(UDMapperRefs);
1250Clause->setClauseInfo(Declarations, ComponentLists);
1256 void*Mem =
C.Allocate(
1288 void*Mem =
C.Allocate(
1296 new(Mem)
OMPFromClause(MotionModifiers, MotionModifiersLoc,
1297UDMQualifierLoc, MapperId, Locs, Sizes);
1300Clause->setUDMapperRefs(UDMapperRefs);
1301Clause->setClauseInfo(Declarations, ComponentLists);
1308 void*Mem =
C.Allocate(
1319 "Number of private copies is not the same as the preallocated buffer");
1325 "Number of inits is not the same as the preallocated buffer");
1326std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
1350 void*Mem =
C.Allocate(
1360Clause->setPrivateCopies(PrivateVars);
1361Clause->setInits(Inits);
1369 void*Mem =
C.Allocate(
1399 void*Mem =
C.Allocate(
1409Clause->setClauseInfo(Declarations, ComponentLists);
1416 void*Mem =
C.Allocate(
1446 void*Mem =
C.Allocate(
1463 void*Mem =
C.Allocate(
1493 void*Mem =
C.Allocate(
1503Clause->setClauseInfo(Declarations, ComponentLists);
1510 void*Mem =
C.Allocate(
1525 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
1534 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
1539assert(VL.size() ==
varlist_size() &&
"Number of private references is not " 1540 "the same as the preallocated buffer");
1549 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1558 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1567 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1576 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1580voidOMPUsesAllocatorsClause::setAllocatorsData(
1582assert(
Data.size() == NumOfAllocators &&
1583 "Size of allocators data is not the same as the preallocated buffer.");
1584 for(
unsignedI = 0,
E=
Data.size(); I <
E; ++I) {
1586getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1587 static_cast<int>(ExprOffsets::Allocator)] =
1589getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1591ExprOffsets::AllocatorTraits)] =
1594 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1595 static_cast<int>(ParenLocsOffsets::LParen)] =
1598 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1599 static_cast<int>(ParenLocsOffsets::RParen)] =
1608getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1609 static_cast<int>(ExprOffsets::Allocator)];
1611getTrailingObjects<Expr *>()[I *
static_cast<int>(ExprOffsets::Total) +
1613ExprOffsets::AllocatorTraits)];
1615 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1616 static_cast<int>(ParenLocsOffsets::LParen)];
1618 SourceLocation>()[I *
static_cast<int>(ParenLocsOffsets::Total) +
1619 static_cast<int>(ParenLocsOffsets::RParen)];
1627 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1628 static_cast<int>(ExprOffsets::Total) *
Data.size(),
1629 static_cast<int>(ParenLocsOffsets::Total) *
Data.size()));
1630 auto*Clause =
new(Mem)
1632Clause->setAllocatorsData(
Data);
1638 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *, SourceLocation>(
1639 static_cast<int>(ExprOffsets::Total) * N,
1640 static_cast<int>(ParenLocsOffsets::Total) * N));
1649 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(Locators.size() + 1));
1650 auto*Clause =
new(Mem)
1652Clause->setModifier(Modifier);
1653Clause->setVarRefs(Locators);
1659 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + 1));
1671 C.Allocate(totalSizeToAlloc<Expr *>(InteropInfo.
PreferTypes.size() + 1));
1674VarLoc, EndLoc, InteropInfo.
PreferTypes.size() + 1);
1675Clause->setInteropVar(InteropVar);
1676llvm::copy(InteropInfo.
PreferTypes, Clause->getTrailingObjects<
Expr*>() + 1);
1681 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1689 return new(
C)
OMPBindClause(K, KLoc, StartLoc, LParenLoc, EndLoc);
1702 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops),
1706Clause->setDependenceType(DepType);
1707Clause->setDependenceLoc(DepLoc);
1708Clause->setColonLoc(ColonLoc);
1710 for(
unsignedI = 0; I < NumLoops; ++I)
1717 unsignedNumLoops) {
1718 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N + NumLoops),
1724assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1725 auto*It = std::next(
getVarRefs().end(), NumLoop);
1730assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1731 auto*It = std::next(
getVarRefs().end(), NumLoop);
1736assert(NumLoop < NumLoops &&
"Loop index must be less number of loops.");
1737 const auto*It = std::next(
getVarRefs().end(), NumLoop);
1746 void*Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1749AC->setDirectiveKinds(DKVec);
1754 void*Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1762 void*Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(DKVec.size()),
1771 void*Mem =
C.Allocate(totalSizeToAlloc<OpenMPDirectiveKind>(K),
1780 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1790 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1798 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
1808 void*Mem =
C.Allocate(totalSizeToAlloc<Expr *>(N));
1818 if(
Node->getNameModifier() != OMPD_unknown)
1819OS << getOpenMPDirectiveName(
Node->getNameModifier()) <<
": ";
1820 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1826 Node->getCondition()->printPretty(OS,
nullptr, Policy, 0);
1831OS <<
"num_threads(";
1832 Node->getNumThreads()->printPretty(OS,
nullptr, Policy, 0);
1838 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
1844 Node->getSafelen()->printPretty(OS,
nullptr, Policy, 0);
1850 Node->getSimdlen()->printPretty(OS,
nullptr, Policy, 0);
1857 for(
auto*Size :
Node->getSizesRefs()) {
1860 Size->printPretty(OS,
nullptr, Policy, 0);
1867OS <<
"permutation(";
1868llvm::interleaveComma(
Node->getArgsRefs(), OS, [&](
const Expr*
E) {
1869E->printPretty(OS, nullptr, Policy, 0);
1874voidOMPClausePrinter::VisitOMPFullClause(
OMPFullClause*
Node) { OS <<
"full"; }
1879 if(
Expr*Factor =
Node->getFactor()) {
1881Factor->printPretty(OS,
nullptr, Policy, 0);
1887OS <<
"allocator(";
1888 Node->getAllocator()->printPretty(OS,
nullptr, Policy, 0);
1894 Node->getNumForLoops()->printPretty(OS,
nullptr, Policy, 0);
1900 Node->getEventHandler()->printPretty(OS,
nullptr, Policy, 0);
1907 unsigned(
Node->getDefaultKind()))
1914 unsigned(
Node->getProcBindKind()))
1919OS <<
"unified_address";
1922voidOMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
1924OS <<
"unified_shared_memory";
1928OS <<
"reverse_offload";
1931voidOMPClausePrinter::VisitOMPDynamicAllocatorsClause(
1933OS <<
"dynamic_allocators";
1936voidOMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
1938OS <<
"atomic_default_mem_order(" 1940 Node->getAtomicDefaultMemOrderKind())
1957<< cast<StringLiteral>(
Node->getMessageString())->getString() <<
"\")";
1964 Node->getFirstScheduleModifier());
1968 Node->getSecondScheduleModifier());
1973 if(
auto*
E=
Node->getChunkSize()) {
1982 if(
auto*
Num=
Node->getNumForLoops()) {
1984 Num->printPretty(OS,
nullptr, Policy, 0);
2005voidOMPClausePrinter::VisitOMPReadClause(
OMPReadClause*) { OS <<
"read"; }
2007voidOMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause*) { OS <<
"write"; }
2011 if(
Node->isExtended()) {
2014 Node->getDependencyKind());
2032 Node->getClauseKind(),
static_cast<int>(
Node->getFailParameter()));
2040 for(
auto&
D:
Node->getDirectiveKinds()) {
2043OS << getOpenMPDirectiveName(
D);
2051 Node->getExpr()->printPretty(OS,
nullptr, Policy, 0);
2058 for(
auto&
D:
Node->getDirectiveKinds()) {
2061OS << getOpenMPDirectiveName(
D);
2071voidOMPClausePrinter::VisitOMPNoOpenMPRoutinesClause(
2073OS <<
"no_openmp_routines";
2077OS <<
"no_parallelism";
2100voidOMPClausePrinter::VisitOMPWeakClause(
OMPWeakClause*) { OS <<
"weak"; }
2106voidOMPClausePrinter::VisitOMPSIMDClause(
OMPSIMDClause*) { OS <<
"simd"; }
2115 Node->getDevice()->printPretty(OS,
nullptr, Policy, 0);
2120 if(!
Node->varlist_empty()) {
2122VisitOMPClauseList(
Node,
'(');
2128 if(!
Node->varlist_empty()) {
2129OS <<
"thread_limit";
2130VisitOMPClauseList(
Node,
'(');
2137 Node->getPriority()->printPretty(OS,
nullptr, Policy, 0);
2142OS <<
"grainsize(";
2148 Node->getGrainsize()->printPretty(OS,
nullptr, Policy, 0);
2153OS <<
"num_tasks(";
2159 Node->getNumTasks()->printPretty(OS,
nullptr, Policy, 0);
2165 Node->getHint()->printPretty(OS,
nullptr, Policy, 0);
2172 for(
const Expr*
E:
Node->prefs()) {
2174OS <<
"prefer_type(";
2182 if(
Node->getIsTarget())
2184 if(
Node->getIsTargetSync()) {
2185 if(
Node->getIsTarget())
2187OS <<
"targetsync";
2190 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2196 Node->getInteropVar()->printPretty(OS,
nullptr, Policy);
2202 if(
Expr*
E=
Node->getInteropVar()) {
2210OS <<
"novariants";
2211 if(
Expr*
E=
Node->getCondition()) {
2220 if(
Expr*
E=
Node->getCondition()) {
2227template<
typenameT>
2228voidOMPClausePrinter::VisitOMPClauseList(
T*
Node,
charStartSym) {
2229 for(
typenameT::varlist_iterator I =
Node->varlist_begin(),
2230 E=
Node->varlist_end();
2232assert(*I &&
"Expected non-null Stmt");
2233OS << (I ==
Node->varlist_begin() ? StartSym :
',');
2234 if(
auto*DRE = dyn_cast<DeclRefExpr>(*I)) {
2235 if(isa<OMPCapturedExprDecl>(DRE->getDecl()))
2236DRE->printPretty(OS,
nullptr, Policy, 0);
2238DRE->getDecl()->printQualifiedName(OS);
2240(*I)->printPretty(OS,
nullptr, Policy, 0);
2245 if(
Node->varlist_empty())
2248 Expr*FirstModifier =
nullptr;
2249 Expr*SecondModifier =
nullptr;
2250 autoFirstAllocMod =
Node->getFirstAllocateModifier();
2251 autoSecondAllocMod =
Node->getSecondAllocateModifier();
2254 if(FirstAllocMod == OMPC_ALLOCATE_allocator ||
2256FirstModifier =
Node->getAllocator();
2257SecondModifier =
Node->getAlignment();
2259FirstModifier =
Node->getAlignment();
2260SecondModifier =
Node->getAllocator();
2265 if(FirstModifier) {
2267 if(!FirstUnknown) {
2271FirstModifier->
printPretty(OS,
nullptr, Policy, 0);
2274 if(SecondModifier) {
2276 if(!SecondUnknown) {
2281SecondModifier->
printPretty(OS,
nullptr, Policy, 0);
2286VisitOMPClauseList(
Node,
' ');
2289VisitOMPClauseList(
Node,
'(');
2295 if(!
Node->varlist_empty()) {
2297VisitOMPClauseList(
Node,
'(');
2303 if(!
Node->varlist_empty()) {
2304OS <<
"firstprivate";
2305VisitOMPClauseList(
Node,
'(');
2311 if(!
Node->varlist_empty()) {
2312OS <<
"lastprivate";
2325 if(!
Node->varlist_empty()) {
2327VisitOMPClauseList(
Node,
'(');
2333 if(!
Node->varlist_empty()) {
2334OS <<
"reduction(";
2335 if(
Node->getModifierLoc().isValid())
2339 Node->getQualifierLoc().getNestedNameSpecifier();
2341 Node->getNameInfo().getName().getCXXOverloadedOperator();
2342 if(QualifierLoc ==
nullptr&& OOK !=
OO_None) {
2347 if(QualifierLoc !=
nullptr)
2348QualifierLoc->
print(OS, Policy);
2349OS <<
Node->getNameInfo();
2352VisitOMPClauseList(
Node,
' ');
2357voidOMPClausePrinter::VisitOMPTaskReductionClause(
2359 if(!
Node->varlist_empty()) {
2360OS <<
"task_reduction(";
2362 Node->getQualifierLoc().getNestedNameSpecifier();
2364 Node->getNameInfo().getName().getCXXOverloadedOperator();
2365 if(QualifierLoc ==
nullptr&& OOK !=
OO_None) {
2370 if(QualifierLoc !=
nullptr)
2371QualifierLoc->
print(OS, Policy);
2372OS <<
Node->getNameInfo();
2375VisitOMPClauseList(
Node,
' ');
2381 if(!
Node->varlist_empty()) {
2382OS <<
"in_reduction(";
2384 Node->getQualifierLoc().getNestedNameSpecifier();
2386 Node->getNameInfo().getName().getCXXOverloadedOperator();
2387 if(QualifierLoc ==
nullptr&& OOK !=
OO_None) {
2392 if(QualifierLoc !=
nullptr)
2393QualifierLoc->
print(OS, Policy);
2394OS <<
Node->getNameInfo();
2397VisitOMPClauseList(
Node,
' ');
2403 if(!
Node->varlist_empty()) {
2405VisitOMPClauseList(
Node,
'(');
2406 if(
Node->getModifierLoc().isValid() ||
Node->getStep() !=
nullptr) {
2409 if(
Node->getModifierLoc().isValid()) {
2412 if(
Node->getStep() !=
nullptr) {
2413 if(
Node->getModifierLoc().isValid()) {
2417 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
2425 if(!
Node->varlist_empty()) {
2427VisitOMPClauseList(
Node,
'(');
2428 if(
Node->getAlignment() !=
nullptr) {
2430 Node->getAlignment()->printPretty(OS,
nullptr, Policy, 0);
2437 if(!
Node->varlist_empty()) {
2439VisitOMPClauseList(
Node,
'(');
2445 if(!
Node->varlist_empty()) {
2446OS <<
"copyprivate";
2447VisitOMPClauseList(
Node,
'(');
2453 if(!
Node->varlist_empty()) {
2454VisitOMPClauseList(
Node,
'(');
2461 Node->getDepobj()->printPretty(OS,
nullptr, Policy, 0);
2467 if(
Expr*DepModifier =
Node->getModifier()) {
2473 boolIsOmpAllMemory =
false;
2474 if(PrintKind == OMPC_DEPEND_outallmemory) {
2475PrintKind = OMPC_DEPEND_out;
2476IsOmpAllMemory =
true;
2477}
else if(PrintKind == OMPC_DEPEND_inoutallmemory) {
2478PrintKind = OMPC_DEPEND_inout;
2479IsOmpAllMemory =
true;
2482 if(!
Node->varlist_empty() || IsOmpAllMemory)
2484VisitOMPClauseList(
Node,
' ');
2485 if(IsOmpAllMemory) {
2486OS << (
Node->varlist_empty() ?
" ":
",");
2487OS <<
"omp_all_memory";
2492template<
typenameT>
2497 Node->getMapperQualifierLoc().getNestedNameSpecifier();
2499MapperNNS->
print(OS, Policy);
2500OS <<
Node->getMapperIdInfo() <<
')';
2503template<
typenameT>
2506 if(
Expr*IteratorModifier =
Node->getIteratorModifier())
2507IteratorModifier->printPretty(OS,
nullptr, Policy);
2511 if(!
Node->varlist_empty()) {
2516 if(
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_iterator) {
2520 Node->getMapTypeModifier(I));
2521 if(
Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_mapper)
2530VisitOMPClauseList(
Node,
' ');
2535template<
typenameT>
voidOMPClausePrinter::VisitOMPMotionClause(
T*
Node) {
2536 if(
Node->varlist_empty())
2538OS << getOpenMPClauseName(
Node->getClauseKind());
2539 unsignedModifierCount = 0;
2544 if(ModifierCount) {
2549 Node->getMotionModifier(I));
2550 if(
Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2552 if(I < ModifierCount - 1)
2557VisitOMPClauseList(
Node,
' ');
2559VisitOMPClauseList(
Node,
'(');
2565VisitOMPMotionClause(
Node);
2569VisitOMPMotionClause(
Node);
2574OMPC_dist_schedule,
Node->getDistScheduleKind());
2575 if(
auto*
E=
Node->getChunkSize()) {
2583OS <<
"defaultmap(";
2585 Node->getDefaultmapModifier());
2589 Node->getDefaultmapKind());
2595 if(!
Node->varlist_empty()) {
2596OS <<
"use_device_ptr";
2597VisitOMPClauseList(
Node,
'(');
2602voidOMPClausePrinter::VisitOMPUseDeviceAddrClause(
2604 if(!
Node->varlist_empty()) {
2605OS <<
"use_device_addr";
2606VisitOMPClauseList(
Node,
'(');
2612 if(!
Node->varlist_empty()) {
2613OS <<
"is_device_ptr";
2614VisitOMPClauseList(
Node,
'(');
2620 if(!
Node->varlist_empty()) {
2621OS <<
"has_device_addr";
2622VisitOMPClauseList(
Node,
'(');
2628 if(!
Node->varlist_empty()) {
2629OS <<
"nontemporal";
2630VisitOMPClauseList(
Node,
'(');
2645 if(!
Node->varlist_empty()) {
2647VisitOMPClauseList(
Node,
'(');
2653 if(!
Node->varlist_empty()) {
2655VisitOMPClauseList(
Node,
'(');
2660voidOMPClausePrinter::VisitOMPUsesAllocatorsClause(
2662 if(
Node->getNumberOfAllocators() == 0)
2664OS <<
"uses_allocators(";
2665 for(
unsignedI = 0,
E=
Node->getNumberOfAllocators(); I <
E; ++I) {
2667 Data.Allocator->printPretty(OS,
nullptr, Policy);
2668 if(
Data.AllocatorTraits) {
2670 Data.AllocatorTraits->printPretty(OS,
nullptr, Policy);
2680 if(
Node->varlist_empty())
2683 charStartSym =
'(';
2684 if(
Expr*Modifier =
Node->getModifier()) {
2686Modifier->printPretty(OS,
nullptr, Policy);
2690VisitOMPClauseList(
Node, StartSym);
2696 Node->getThreadID()->printPretty(OS,
nullptr, Policy, 0);
2706voidOMPClausePrinter::VisitOMPXDynCGroupMemClause(
2708OS <<
"ompx_dyn_cgroup_mem(";
2709 Node->getSize()->printPretty(OS,
nullptr, Policy, 0);
2718 caseOMPC_DOACROSS_source:
2721 caseOMPC_DOACROSS_sink:
2724 caseOMPC_DOACROSS_source_omp_cur_iteration:
2725OS <<
"source: omp_cur_iteration";
2727 caseOMPC_DOACROSS_sink_omp_cur_iteration:
2728OS <<
"sink: omp_cur_iteration - 1";
2731llvm_unreachable(
"unknown docaross modifier");
2733VisitOMPClauseList(
Node,
' ');
2738OS <<
"ompx_attribute(";
2739 boolIsFirst =
true;
2740 for(
auto&
Attr:
Node->getAttrs()) {
2754VariantMatchInfo &VMI)
const{
2759 if(
Selector.Kind == TraitSelector::user_condition) {
2760assert(
Selector.ScoreOrCondition &&
2761 "Ill-formed user condition, expected condition expression!");
2762assert(
Selector.Properties.size() == 1 &&
2763 Selector.Properties.front().Kind ==
2764TraitProperty::user_condition_unknown &&
2765 "Ill-formed user condition, expected unknown trait property!");
2767 if(std::optional<APSInt> CondVal =
2768 Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx))
2769VMI.addTrait(CondVal->isZero() ? TraitProperty::user_condition_false
2770: TraitProperty::user_condition_true,
2773VMI.addTrait(TraitProperty::user_condition_false,
"<condition>");
2777std::optional<llvm::APSInt> Score;
2778llvm::APInt *ScorePtr =
nullptr;
2780 if((Score =
Selector.ScoreOrCondition->getIntegerConstantExpr(ASTCtx)))
2783VMI.addTrait(TraitProperty::user_condition_false,
2784 "<non-constant-score>");
2790 if(
Set.Kind != TraitSet::construct)
2794assert(
Selector.Properties.size() == 1 &&
2795 Selector.Properties.front().Kind ==
2796getOpenMPContextTraitPropertyForSelector(
2798 "Ill-formed construct selector!");
2805 boolFirstSet =
true;
2810OS << getOpenMPContextTraitSetName(
Set.Kind) <<
"={";
2812 boolFirstSelector =
true;
2816FirstSelector =
false;
2817OS << getOpenMPContextTraitSelectorName(
Selector.Kind);
2819 boolAllowsTraitScore =
false;
2820 boolRequiresProperty =
false;
2821isValidTraitSelectorForTraitSet(
2822 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
2824 if(!RequiresProperty)
2828 if(
Selector.Kind == TraitSelector::user_condition) {
2830 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2837 Selector.ScoreOrCondition->printPretty(OS,
nullptr, Policy);
2841 boolFirstProperty =
true;
2845FirstProperty =
false;
2846OS << getOpenMPContextTraitPropertyName(
Property.Kind,
2857std::string MangledName;
2858llvm::raw_string_ostream OS(MangledName);
2863 boolAllowsTraitScore =
false;
2864 boolRequiresProperty =
false;
2865isValidTraitSelectorForTraitSet(
2866 Selector.Kind,
Set.Kind, AllowsTraitScore, RequiresProperty);
2869 if(!RequiresProperty ||
2870 Selector.Kind == TraitSelector::user_condition)
2875<< getOpenMPContextTraitPropertyName(
Property.Kind,
2882OMPTraitInfo::OMPTraitInfo(StringRef MangledName) {
2885 if(!MangledName.consume_front(
"$S"))
2887 if(MangledName.consumeInteger(10,
U))
2891 Set.Kind = TraitSet(
U);
2893 if(!MangledName.consume_front(
"$s"))
2895 if(MangledName.consumeInteger(10,
U))
2901 if(!MangledName.consume_front(
"$P"))
2905std::pair<StringRef, StringRef> PropRestPair = MangledName.split(
'$');
2906 Property.RawString = PropRestPair.first;
2907 Property.Kind = getOpenMPContextTraitPropertyKind(
2909MangledName = MangledName.drop_front(PropRestPair.first.size());
2919TI.
print(OS, Policy);
2924 returnTI ? OS << *TI : OS;
2928 ASTContext&ASTCtx, std::function<
void(StringRef)> &&DiagUnknownTrait,
2931: OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
2932ASTCtx.getTargetInfo().getTriple()),
2933FeatureValidityCheck([&](StringRef FeatureName) {
2936DiagUnknownTrait(std::move(DiagUnknownTrait)) {
2939 for(llvm::omp::TraitProperty
Property: ConstructTraits)
2944 autoIt = FeatureMap.find(RawString);
2945 if(It != FeatureMap.end())
2947 if(!FeatureValidityCheck(RawString))
2948DiagUnknownTrait(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, Expr *Alignment, SourceLocation ColonLoc, OpenMPAllocateClauseModifier Modifier1, SourceLocation Modifier1Loc, OpenMPAllocateClauseModifier Modifier2, SourceLocation Modifier2Loc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
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 class represents the 'permutation' clause in the '#pragma omp interchange' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static OMPPermutationClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'permutation' AST node for deserialization.
static OMPPermutationClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Args)
Build a 'permutation' clause AST node.
This represents '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|flush' directives.
This represents 'severity' clause in the '#pragma omp error' directive.
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 '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
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
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)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4